From c2172c94524cff1958de412eedd9efa21f60466f Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 14 May 2022 15:36:37 -0500 Subject: Corregidos errores --- src/ampache/exceptions.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'src/ampache/exceptions.py') 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 -- cgit v1.2.3