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

Custom exceptions #77

Open
sadielbartholomew opened this issue Sep 15, 2020 · 0 comments
Open

Custom exceptions #77

sadielbartholomew opened this issue Sep 15, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@sadielbartholomew
Copy link
Member

cfdm does not use any custom exceptions, other than DeprecationError in mixin.netcdf. We could likely make some classes a bit cleaner & improve user feedback on errors etc. by creating & applying some custom exception classes for which to delegate some error handling.

(Copied, minus noise & with a little tidying, from #64 (comment))

Ideas

I can flesh this out further e.g. with some potential inheritance structure as we think about it & work out what might be useful, but firstly to record some potential candidates for useful exceptions:

  • cfdm implementation errors (relating to attempts to subclass);
  • CF compliance warnings (as specific forms of Python warnings lib warnings that the user can opt to enable or disable by interfacing with the logging framework);
  • construct i.e. metadata errors:
    • missing i.e. not defined when expected/required;
    • mismatched dimensions or shape;
    • invalid;
    • etc.
  • data errors, e.g perhaps:
    • array-related;
    • compression-related;
  • field construct operation errors:
    • on reading fields;
    • on writing fields;
    • on aggregation;
  • errors related to a specific encoding, notably netCDF.
@davidhassell davidhassell added the enhancement New feature or request label Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants