Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Re2o
Re2o API client
Commits
729cfcb7
Commit
729cfcb7
authored
Jan 12, 2021
by
nanoy
Browse files
Merge branch 'better_403_error' into 'master'
Better 403 error message See merge request
!2
parents
ffaed921
6d930e37
Changes
2
Hide whitespace changes
Inline
Side-by-side
re2oapi/client.py
View file @
729cfcb7
...
...
@@ -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
()
...
...
re2oapi/exceptions.py
View file @
729cfcb7
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment