This website requires JavaScript.
Explore
Help
Sign in
voussoir
/
megapy
Watch
1
Star
0
Fork
You've already forked megapy
0
Code
Issues
Pull requests
Projects
Releases
Packages
Wiki
Activity
78cb1706ed
megapy
/
src
/
mega
/
__init__.py
3 lines
52 B
Python
Raw
Normal View
History
Unescape
Escape
various fixes
2019-10-16 20:20:22 +00:00
from
.
mega
import
Mega
# noqa
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-24 01:54:29 +00:00
from
.
import
errors
Reference in a new issue
Copy permalink