summaryrefslogtreecommitdiff
path: root/src/ampache/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ampache/exceptions.py')
-rw-r--r--src/ampache/exceptions.py51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/ampache/exceptions.py b/src/ampache/exceptions.py
index 345d8e2..af0cbf0 100644
--- a/src/ampache/exceptions.py
+++ b/src/ampache/exceptions.py
@@ -1,6 +1,16 @@
+ACCESS_ERROR_CODE = 4700
+AUTHENTICATION_ERROR_CODE = 4701
+ACCESS_DENIED_ERROR_CODE = 4703
+NOT_FOUND_ERROR_CODE = 4704
+MISSING_ERROR_CODE = 4705
+DEPRECIATED_ERROR_CODE = 4706
+BAD_REQUEST_ERROR_CODE = 4710
+FAILED_ACCESS_ERROR_CODE = 4712
+
+
class AccessException(Exception):
"""
- Happens when the API is not enabled. Error code: 4700-
+ Happens when the API is not enabled. Error code: 4700.
"""
pass
@@ -18,3 +28,42 @@ class AccessDeniedException(Exception):
Happens when the request method is not enabled. Error code: 4703
"""
pass
+
+
+class NotFoundException(Exception):
+ """
+ Happens when the requested object couldn't be found. Error code:
+ 4704
+ """
+ pass
+
+
+class MissingMethodException(Exception):
+ """
+ Happens when the client requests a method the API doesn't implement.
+ Error code: 4705
+ """
+ pass
+
+
+class DepreciatedMethodException(Exception):
+ """
+ Happens when a given method is deprecated. Error code: 4706.
+ """
+ pass
+
+
+class BadRequestException(Exception):
+ """
+ Happens when the API recieves a wrongly formed request. Error code:
+ 4710.
+ """
+ pass
+
+
+class FailedAccessException(Exception):
+ """
+ Happens when the object or method can't be accessed by a given user.
+ Error code: 4712.
+ """
+ pass