Skip to content

Commit

Permalink
Improve exception raises (flake8)
Browse files Browse the repository at this point in the history
  • Loading branch information
allerter committed Oct 27, 2024
1 parent 86a143b commit 1386576
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lyricsgenius/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1386576

Please sign in to comment.