Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o-re2oapi
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 re2o/re2oapi!2
parents
ffaed921
6d930e37
Changes
2
Show whitespace changes
Inline
Side-by-side
re2oapi/client.py
View file @
729cfcb7
...
@@ -265,7 +265,7 @@ class Re2oAPIClient:
...
@@ -265,7 +265,7 @@ class Re2oAPIClient:
self
.
log
.
debug
(
"Response code: "
+
str
(
response
.
status_code
))
self
.
log
.
debug
(
"Response code: "
+
str
(
response
.
status_code
))
if
response
.
status_code
==
requests
.
codes
.
forbidden
:
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
)
self
.
log
.
debug
(
e
)
raise
e
raise
e
response
.
raise_for_status
()
response
.
raise_for_status
()
...
...
re2oapi/exceptions.py
View file @
729cfcb7
...
@@ -12,7 +12,7 @@ class InvalidCredentials(APIClientGenericError):
...
@@ -12,7 +12,7 @@ class InvalidCredentials(APIClientGenericError):
class
PermissionDenied
(
APIClientGenericError
):
class
PermissionDenied
(
APIClientGenericError
):
template
=
"The {} request to '{}' was denied for {}."
template
=
"The {} request to '{}' was denied for {}
(reason: {})
."
class
TokenFileNotFound
(
APIClientGenericError
):
class
TokenFileNotFound
(
APIClientGenericError
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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