diff options
Diffstat (limited to 'gitlab/exceptions.py')
-rw-r--r-- | gitlab/exceptions.py | 11 |
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 |