Queer European MD passionate about IT
Browse Source

Catch specific Exception

Davte 5 years ago
parent
commit
c46f6fee52
1 changed files with 1 additions and 1 deletions
  1. 1 1
      davtelepot/utilities.py

+ 1 - 1
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")