3 ms·
From reading the title, I assumed they wanted to make me handle all Errortypes explicitly. However, they just want to replace this: try: risky_operation(
by Sweepi 2y ago
From reading the title, I assumed they wanted to make me handle all Errortypes explicitly. However, they just want to replace this:
try:
risky_operation()
except:
handle_any_error()
with this:
try:
risky_operation()
except Exception as e:
handle_expected_error(e)
and this will also be legal:
try:
risky_operation()
except Exception as e:
pass
... seems fine to me, but its off the table anyway.