Commit 729cfcb7 authored by nanoy's avatar nanoy

Merge branch 'better_403_error' into 'master'

Better 403 error message

See merge request re2o/re2oapi!2
parents ffaed921 6d930e37
......@@ -265,7 +265,7 @@ class Re2oAPIClient:
self.log.debug("Response code: "+str(response.status_code))
if response.status_code == requests.codes.forbidden:
e = exceptions.PermissionDenied(method, url, self._username)
e = exceptions.PermissionDenied(method, url, self._username, response.reason)
self.log.debug(e)
raise e
response.raise_for_status()
......
......@@ -12,7 +12,7 @@ class InvalidCredentials(APIClientGenericError):
class PermissionDenied(APIClientGenericError):
template = "The {} request to '{}' was denied for {}."
template = "The {} request to '{}' was denied for {} (reason: {})."
class TokenFileNotFound(APIClientGenericError):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment