Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of generic exception catching #205

Open
ricardobranco777 opened this issue Feb 14, 2023 · 1 comment
Open

Get rid of generic exception catching #205

ricardobranco777 opened this issue Feb 14, 2023 · 1 comment

Comments

@ricardobranco777
Copy link
Collaborator

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.

@asmorodskyi
Copy link
Collaborator

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 :

  1. catching Exception ( as we doing currently )
  2. 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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants