Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
res = cause.response
if res:
try:
self.http_status = res.status_code
self.json_body = res.json()
self.code = self.json_body['error']
message = self.json_body['message']
except (KeyError, ValueError):
message = str(cause)
else:
message = str(cause)
super().__init__(message)
class AuthenticationError(Error):
pass
class NotFoundError(Error):
pass
class BadRequestError(Error):
pass
self.json_body = res.json()
self.code = self.json_body['error']
message = self.json_body['message']
except (KeyError, ValueError):
message = str(cause)
else:
message = str(cause)
super().__init__(message)
class AuthenticationError(Error):
pass
class NotFoundError(Error):
pass
class BadRequestError(Error):
pass
message = str(cause)
else:
message = str(cause)
super().__init__(message)
class AuthenticationError(Error):
pass
class NotFoundError(Error):
pass
class BadRequestError(Error):
pass