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