Skip to content

Commit

Permalink
Merge pull request #1148 from Metro-Records/hcg/connection-error
Browse files Browse the repository at this point in the history
Handle connection error in api_representation, closes #1143
  • Loading branch information
hancush authored Jul 24, 2024
2 parents c91573a + 3a3da9c commit 866e6d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lametro/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def api_representation(self):
)
return None

except requests.ConnectionError:
logger.warning(f"Request to {self.api_source.url} disconnected.")
return None

return response.json()


Expand Down

0 comments on commit 866e6d9

Please sign in to comment.