You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try:
# something that might failexcept:
return# or pass or something like that
Sometimes there's good reason for a "bare except", but a lot of times it could hide an unexpected error. It's better to list the expected exceptions explicitly [how's that for alliteration?]. An example is:
I think this might have meant to catch missing audio files, but it started catching audioio.WaveFile() failure (because now it's audiocore.WaveFile().) and not complaining. This made the failure non-obvious to an experienced user in the forums.
The text was updated successfully, but these errors were encountered:
A number of examples here have code like:
Sometimes there's good reason for a "bare except", but a lot of times it could hide an unexpected error. It's better to list the expected exceptions explicitly [how's that for alliteration?]. An example is:
Adafruit_Learning_System_Guides/Hallowing_Lightsaber/lightsaber_standard.py
Lines 52 to 57 in 4879082
I think this might have meant to catch missing audio files, but it started catching
audioio.WaveFile()
failure (because now it'saudiocore.WaveFile()
.) and not complaining. This made the failure non-obvious to an experienced user in the forums.The text was updated successfully, but these errors were encountered: