From 3a3da9cecd28962dfc1c58916716befe388350ab Mon Sep 17 00:00:00 2001 From: Hannah Cushman Garland Date: Wed, 24 Jul 2024 11:14:34 -0500 Subject: [PATCH] Handle connection error, closes #1143 --- lametro/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lametro/models.py b/lametro/models.py index a3833731..5e169b79 100644 --- a/lametro/models.py +++ b/lametro/models.py @@ -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()