Queer European MD passionate about IT
Преглед на файлове

Catch specific Exception

Davte преди 5 години
родител
ревизия
c46f6fee52
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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")