See #3. There are 19 cases of except Exception and 11 of `raise Exception. Python's philosophy is to raise the most specific error possible so that exception handlers and humans have the most information possible. The way to achieve this is via:
[x] narrowing all of the raise statements
[x] carefully narrow the except statements, in case any are untested.
In addition, a lot of code uses the antipattern:
try:
do something
except Exception:
raise
which does the same thing as
do something
Out of scope for this issue but also germane is the use of internal status-passing with integer codes, rather than raising an exception.
See #3. There are 19 cases of
except Exception
and 11 of `raise Exception. Python's philosophy is to raise the most specific error possible so that exception handlers and humans have the most information possible. The way to achieve this is via:raise
statementsexcept
statements, in case any are untested.In addition, a lot of code uses the antipattern:
which does the same thing as
Out of scope for this issue but also germane is the use of internal status-passing with integer codes, rather than raising an exception.
Ref: https://docs.python.org/3/library/exceptions.html