summaryrefslogtreecommitdiff
path: root/gitlab/exceptions.py
diff options
context:
space:
mode:
authorJoost Evertse <joustie@gmail.com>2019-01-21 13:36:56 +0100
committerGitHub <noreply@github.com>2019-01-21 13:36:56 +0100
commitb51d2969ad34a9aad79e42a69f275caf2a4059cb (patch)
treea4519d935a0b5ae5361cb178318402e09da17d75 /gitlab/exceptions.py
parent53f7de7bfe0056950a8e7271632da3f89e3ba3b3 (diff)
parent52d76312660109d3669d459b11b448a3a60b9603 (diff)
downloadgitlab-b51d2969ad34a9aad79e42a69f275caf2a4059cb.tar.gz
Merge branch 'master' into master
Diffstat (limited to 'gitlab/exceptions.py')
-rw-r--r--gitlab/exceptions.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/gitlab/exceptions.py b/gitlab/exceptions.py
index ddaef31..5b7b75c 100644
--- a/gitlab/exceptions.py
+++ b/gitlab/exceptions.py
@@ -28,7 +28,12 @@ class GitlabError(Exception):
# Full http response
self.response_body = response_body
# Parsed error message from gitlab
- self.error_message = error_message
+ try:
+ # if we receive str/bytes we try to convert to unicode/str to have
+ # consistent message types (see #616)
+ self.error_message = error_message.decode()
+ except Exception:
+ self.error_message = error_message
def __str__(self):
if self.response_code is not None:
@@ -41,6 +46,10 @@ class GitlabAuthenticationError(GitlabError):
pass
+class RedirectError(GitlabError):
+ pass
+
+
class GitlabParsingError(GitlabError):
pass