From 79fef262c3e05ff626981c891d9377abb1e18533 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Mon, 30 Mar 2020 01:19:23 +0200 Subject: chore: use raise..from for chained exceptions (#939) --- gitlab/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gitlab/config.py') diff --git a/gitlab/config.py b/gitlab/config.py index 2272dd3..1b665ed 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -60,18 +60,18 @@ class GitlabConfigParser(object): if self.gitlab_id is None: try: self.gitlab_id = self._config.get("global", "default") - except Exception: + except Exception as e: raise GitlabIDError( "Impossible to get the gitlab id (not specified in config file)" - ) + ) from e try: self.url = self._config.get(self.gitlab_id, "url") - except Exception: + except Exception as e: raise GitlabDataError( "Impossible to get gitlab informations from " "configuration (%s)" % self.gitlab_id - ) + ) from e self.ssl_verify = True try: -- cgit v1.2.1