From c46f6fee52b36a3c7306734ee6b939db4b251f45 Mon Sep 17 00:00:00 2001 From: Davte Date: Fri, 12 Jul 2019 14:16:38 +0200 Subject: [PATCH] Catch specific Exception --- davtelepot/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/davtelepot/utilities.py b/davtelepot/utilities.py index 5eacf35..7056c63 100644 --- a/davtelepot/utilities.py +++ b/davtelepot/utilities.py @@ -195,7 +195,7 @@ async def async_request(url, type='get', mode='json', encoding='utf-8', result = json.loads( result ) - except Exception as e: + except json.decoder.JSONDecodeError: result = {} elif mode == 'html': result = BeautifulSoup(result, "html.parser")