summaryrefslogtreecommitdiff
path: root/gitlab/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/exceptions.py')
-rw-r--r--gitlab/exceptions.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gitlab/exceptions.py b/gitlab/exceptions.py
index 8190696..49a3728 100644
--- a/gitlab/exceptions.py
+++ b/gitlab/exceptions.py
@@ -116,7 +116,12 @@ def raise_error_from_response(response, error, expected_code=200):
class to raise. Should be inherited from GitLabError
"""
- if expected_code == response.status_code:
+ if isinstance(expected_code, int):
+ expected_codes = [expected_code]
+ else:
+ expected_codes = expected_code
+
+ if response.status_code in expected_codes:
return
try: