mirror of
https://github.com/enpaul/kodak.git
synced 2024-11-23 15:07:13 +00:00
Add custom exceptions module
This commit is contained in:
parent
d6ae786877
commit
822f40122e
39
imagemonk/exceptions.py
Normal file
39
imagemonk/exceptions.py
Normal file
@ -0,0 +1,39 @@
|
||||
"""Application exceptions
|
||||
|
||||
::
|
||||
|
||||
ImageMonkException
|
||||
+-- ClientError
|
||||
+-- ServerError
|
||||
"""
|
||||
|
||||
|
||||
class ImageMonkException(Exception):
|
||||
"""Whomp whomp, something went wrong
|
||||
|
||||
But seriously, don't ever raise this exception
|
||||
"""
|
||||
|
||||
status: int
|
||||
|
||||
|
||||
class ClientError(ImageMonkException):
|
||||
"""Error while processing client side input"""
|
||||
|
||||
status = 400
|
||||
|
||||
|
||||
class ImageResourceDeletedError(ClientError):
|
||||
"""Requested image resource has been deleted"""
|
||||
|
||||
status = 410
|
||||
|
||||
|
||||
class ServerError(ImageMonkException):
|
||||
"""Error while processing server side data"""
|
||||
|
||||
status = 500
|
||||
|
||||
|
||||
class ImageFileRemovedError(ServerError):
|
||||
"""Image file removed from server"""
|
Loading…
Reference in New Issue
Block a user