Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# PRIVATE
# extracts the error description from the response, if it exists
def __determine_description(self):
if (self.response and self.response.parsed):
if 'errors' in self.response.result:
return self.response.result['errors']
if 'error_description' in self.response.result:
return self.response.result
# sets the error code to the name of this class
def __determine_code(self):
return self.__class__.__name__
class NetworkError(ResponseError):
"""
This error occurs when there is some kind of error in the network
"""
pass
class ParserError(ResponseError):
"""
This error occurs when the response type was JSOn but could not be parsed
"""
pass
class ServerError(ResponseError):
"""
This error occurs when there is an error on the server
class ServerError(ResponseError):
"""
This error occurs when there is an error on the server
"""
pass
class ClientError(ResponseError):
"""
This error occurs when the client did not provide the right parameters
"""
pass
class AuthenticationError(ResponseError):
"""
This error occurs when the client did not provide the right credentials
"""
pass
class NotFoundError(ResponseError):
"""
This error occurs when the path could not be found
"""
pass
class ParserError(ResponseError):
"""
This error occurs when the response type was JSOn but could not be parsed
"""
pass
class ServerError(ResponseError):
"""
This error occurs when there is an error on the server
"""
pass
class ClientError(ResponseError):
"""
This error occurs when the client did not provide the right parameters
"""
pass
class AuthenticationError(ResponseError):
"""
This error occurs when the client did not provide the right credentials
"""
pass
class NotFoundError(ResponseError):
"""
This error occurs when the path could not be found
class ClientError(ResponseError):
"""
This error occurs when the client did not provide the right parameters
"""
pass
class AuthenticationError(ResponseError):
"""
This error occurs when the client did not provide the right credentials
"""
pass
class NotFoundError(ResponseError):
"""
This error occurs when the path could not be found
"""
pass
if 'error_description' in self.response.result:
return self.response.result
# sets the error code to the name of this class
def __determine_code(self):
return self.__class__.__name__
class NetworkError(ResponseError):
"""
This error occurs when there is some kind of error in the network
"""
pass
class ParserError(ResponseError):
"""
This error occurs when the response type was JSOn but could not be parsed
"""
pass
class ServerError(ResponseError):
"""
This error occurs when there is an error on the server
"""
pass
class ClientError(ResponseError):
"""
This error occurs when the client did not provide the right parameters
class NetworkError(ResponseError):
"""
This error occurs when there is some kind of error in the network
"""
pass
class ParserError(ResponseError):
"""
This error occurs when the response type was JSOn but could not be parsed
"""
pass
class ServerError(ResponseError):
"""
This error occurs when there is an error on the server
"""
pass
class ClientError(ResponseError):
"""
This error occurs when the client did not provide the right parameters
"""
pass
class AuthenticationError(ResponseError):
"""
This error occurs when the client did not provide the right credentials