diff options
author | HombreLaser <sebastian-440@live.com> | 2022-05-14 15:36:37 -0500 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-05-14 15:36:37 -0500 |
commit | c2172c94524cff1958de412eedd9efa21f60466f (patch) | |
tree | 209f8f975d8a70f480d69735a9a01564111840ca /src/ampache/exceptions.py | |
parent | 74b01c4942e38afce9efdf60fa46ab573f4f6f86 (diff) |
Corregidos errores
Diffstat (limited to 'src/ampache/exceptions.py')
-rw-r--r-- | src/ampache/exceptions.py | 51 |
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 |