Queer European MD passionate about IT
Procházet zdrojové kódy

Catch specific Exception

Davte před 5 roky
rodič
revize
c46f6fee52
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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")