From 1386576d33a25f383578bc0bb8bc0b775f20ce0c Mon Sep 17 00:00:00 2001 From: Hazhir Date: Sun, 27 Oct 2024 15:03:24 +0100 Subject: [PATCH] Improve exception raises (flake8) --- lyricsgenius/api/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lyricsgenius/api/base.py b/lyricsgenius/api/base.py index 31d73122..e6e6d3d1 100644 --- a/lyricsgenius/api/base.py +++ b/lyricsgenius/api/base.py @@ -81,11 +81,11 @@ def _make_request( except Timeout as e: error = "Request timed out:\n{e}".format(e=e) if tries > self.retries: - raise Timeout(error) + raise Timeout(error) from e except HTTPError as e: error = get_description(e) if response.status_code < 500 or tries > self.retries: - raise HTTPError(response.status_code, error) + raise HTTPError(response.status_code, error) from e # Enforce rate limiting time.sleep(self.sleep_time)