Closed birgersp closed 5 years ago
Also, when using a proper IDE or code editor, exceptions are properly visualized:
I'm no python expert and this way I try to avoid the code bombs out for often not to clear reasons. Now I can exactly see where an error occurred. For me it is simpler, if you want to do the differently you are free to publish your own version.
Hi,
I noticed you're catching exceptions inside functions. Example:
Why are you doing this? Exceptions are meant to show the developers exactly where a problem occurs. When you are doing this, you're reducing the error to a single line of text which makes the developer have to dig through the source code to find the source of error.
Also now the script has to check the result of each of the functions, which is unnecessary when you have exceptions interrupting the execution of the script. As shown here:
The example function should simply be: