Commit graph

2 commits

Author SHA1 Message Date
Ethan Dalool
62871e3240 Add separate classes for API exceptions, raise error_for_code().
This makes the caller's life easier. They can catch
mega.errors.EFAILED instead of catching mega.errors.RequestError
and checking the message attribute.
Because these classes inherit from RequestError, and they have a code
and message attribute, anyone currently catching RequestError should
not have any backwards compatibility issues.
Furthermore, this fixes an existing issue in the codebase where
RequestError is raised with a custom string message, which was causing
IndexError since that message wasn't in CODE_TO_DESCRIPTIONS.
2020-03-23 18:54:29 -07:00
Richard O'Dwyer
a15095ab9d modernize packaging 2019-10-16 22:16:46 +01:00
Renamed from mega/__init__.py (Browse further)