3 ms·
My pattern on this stuff is to initially write: try: do_something() except ExpectedException: handle_it() except OtherKnownException: h
by kstrauser 10y ago
My pattern on this stuff is to initially write:
try:
do_something()
except ExpectedException:
handle_it()
except OtherKnownException:
handle_that_too()
except Exception as exc:
log.exception('New kind of error just happened')
handle_fallback()
- greglindahl 10y agoYes, that's basically what I'm doing.