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

Create, organize, and apply dedicated INDRA exceptions #486

Open
pagreene opened this issue Apr 9, 2018 · 3 comments
Open

Create, organize, and apply dedicated INDRA exceptions #486

pagreene opened this issue Apr 9, 2018 · 3 comments
Assignees
Milestone

Comments

@pagreene
Copy link
Contributor

pagreene commented Apr 9, 2018

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 pagreene added this to the Refactoring milestone Apr 9, 2018
@pagreene pagreene self-assigned this Apr 9, 2018
@cthoyt
Copy link
Collaborator

cthoyt commented Apr 10, 2018

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.

@pagreene
Copy link
Contributor Author

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.

@cthoyt
Copy link
Collaborator

cthoyt commented Apr 10, 2018

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

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

No branches or pull requests

2 participants