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

Assess/revise exceptions hierarchy #17

Closed
thebigmunch opened this issue Feb 15, 2020 · 1 comment
Closed

Assess/revise exceptions hierarchy #17

thebigmunch opened this issue Feb 15, 2020 · 1 comment

Comments

@thebigmunch
Copy link
Owner

  • Do we need all these specific exceptions? If not, what do we need?
  • Should the exception categories be rethought/reorganized/generalized?
  • Just use one exception class?
@thebigmunch
Copy link
Owner Author

thebigmunch commented Mar 19, 2020

So, I think the best thing to do to start is to strip everything down to a small number of generic exceptions:

  • AudioMetadataException - The base exception for all exceptions deriving from audio-metadata.
  • UnsupportedFormat - The exception raised when encountering a file format not supported by audio-metadata. This includes formats that are generally supported, but a specific version or profile of that format is not supported.
  • FormatError - The exception raised when the binary format of the file is invalid in some way. This would encompass the previous exceptions:
    • InvalidBlock
    • InvalidChunk
    • InvalidFormat
    • InvalidFrame in the context of MPEG frames, and invalid binary format of ID3v2 frames.
    • InvalidHeader
  • TagError - The exception raised when there is an issue with a tag not related to the binary format. For example. an ID3v2 TYER frame containg an ISO-8601 datetime instead of just a year. This might be changed to a warning in Add strict/lenient modes with toggles #18.

Adding any more exceptions or adding arguments to these exceptions can be discussed as potential needs arise.

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

1 participant