From 88b1fad853edb0691ce8442eaf9e6e8a19608df3 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Tue, 14 Jun 2022 22:51:06 +0200 Subject: [PATCH] Fix missing exception --- codecarbon/external/geography.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecarbon/external/geography.py b/codecarbon/external/geography.py index 965c0967e..6c90fe38d 100644 --- a/codecarbon/external/geography.py +++ b/codecarbon/external/geography.py @@ -81,7 +81,7 @@ def __repr__(self) -> str: def from_geo_js(cls, url: str) -> "GeoMetadata": try: response: Dict = requests.get(url, timeout=0.5).json() - except requests.exceptions.Timeout: + except (requests.exceptions.Timeout, requests.exceptions.ConnectionError): # If there is a timeout, we default to Canada logger.info( "Unable to access geographical location. \