summaryrefslogtreecommitdiff
path: root/gitlab/exceptions.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-05-13 19:07:48 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2016-05-13 19:07:48 +0200
commit1de6b7e7641f2c0cb101a82385cee569aa786e3f (patch)
tree832c5258a16d2c83e70a243db8c1b623bfa89959 /gitlab/exceptions.py
parent24c283f5861f21e51489afc815bd9f31bff58bee (diff)
downloadgitlab-1de6b7e7641f2c0cb101a82385cee569aa786e3f.tar.gz
implement star/unstar for projects
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: