Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions pushnotifier/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
MalformedRequestError = Exception('the request is malformed, i.e. missing content')
DeviceNotFoundError = Exception('a device couldn\'t be found')
UserNotFoundError = Exception('user couldn\'t be found (incorrect username/password)')
IncorrectCredentialsError = Exception('credentials are incorrect')
UnauthorizedError = Exception('package name or api key is incorrect')
PayloadTooLargeError = Exception('your image is too big (> 5 MB)')
UnsupportedMediaTypeError = Exception('you passed an invalid file type or the device(s) you tried to send this image to can\'t receive images')
# define Python user-defined exceptions
class MalformedRequestError(Exception):
"the request is malformed, i.e. missing content"
pass

UnknownError = Exception('an unknown error occured! please contact the author of this module!')
class DeviceNotFoundError(Exception):
"a device couldn't be found"
pass

class UserNotFoundError(Exception):
"user couldn't be found (incorrect username/password)"
pass

class IncorrectCredentialsError(Exception):
"credentials are incorrect"
pass

class UnauthorizedError(Exception):
"package name or api key is incorrect"
pass

class PayloadTooLargeError(Exception):
"your image is too big (> 5 MB)"
pass

class UnsupportedMediaTypeError(Exception):
"you passed an invalid file type or the device(s) you tried to send this image to can\'t receive images)"
pass

class UnknownError(Exception):
"an unknown error occured! please contact the author of this module!"
pass