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