by kortex · 7y ago · 0 comments
try:
something() # that throws nonfatal errors frequently
except:
pass
"it saves time in development" they say. Good luck if something in that (non trivial) function call breaks.Ugh.
Don't be like that.
If you don't know the precise error, heres the solution (in python):
except Exception as exc:
log("{}: {}".format(type(exc).__name__, exc))
Bingo, you now know what to catch. Catch that error, move your broad exception down (or remove if you can)