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
The code has a lot of except Exception that is not only a bad practice but harmful when trying to catch or debug other exceptions in code. In each case we must list all expected exceptions, however painful it is.
The text was updated successfully, but these errors were encountered:
in all cases of catching Exception it is done because we don't want interruption in ANY case , so no matter what happened we want code to keep running . E.g. when we have a loop of cleanup between different providers and accounts we saying "no matter what happened for this combination of provider and account we DO want to trying all other combinations ". There is two ways to achieve that :
catching Exception ( as we doing currently )
catching exact exceptions and pass through long list of iterations where we catching something new which interrupt our loop and add it to the list
Sorry I am not following still which benefits we will get in second scenario ?
The code has a lot of
except Exception
that is not only a bad practice but harmful when trying to catch or debug other exceptions in code. In each case we must list all expected exceptions, however painful it is.The text was updated successfully, but these errors were encountered: