indra
indra copied to clipboard
Create, organize, and apply dedicated INDRA exceptions
There could be a parent IndraError
exception class, from which all other INDRA exceptions inherit, and sub-modules could get their own classes, and so on. This would allow for better filtering of exceptions by users, as well as ourselves.
In my big projects, I've put exc.py
with a base "exception" and base "warning". Then I put another exc.py
in each submodule with more specific stuff.
That was basically my plan, although perhaps not in separate files for the submodules, but rather in each file as needed unless a parent exception is warranted for the module, in which case I would add a separate file with that parent exception.
One rationale for doing this is to have lots of smaller python files that don't have large public namespaces, then aggregate all of the useful stuff in each module in the __init__.py
. This might also be another thing to consider while refactoring :)