indra icon indicating copy to clipboard operation
indra copied to clipboard

Create, organize, and apply dedicated INDRA exceptions

Open pagreene opened this issue 6 years ago • 3 comments

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.

pagreene avatar Apr 09 '18 14:04 pagreene

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.

cthoyt avatar Apr 10 '18 16:04 cthoyt

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.

pagreene avatar Apr 10 '18 16:04 pagreene

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 :)

cthoyt avatar Apr 10 '18 16:04 cthoyt