Catch specific Exception
This commit is contained in:
parent
a2965be066
commit
c46f6fee52
@ -195,7 +195,7 @@ async def async_request(url, type='get', mode='json', encoding='utf-8',
|
|||||||
result = json.loads(
|
result = json.loads(
|
||||||
result
|
result
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except json.decoder.JSONDecodeError:
|
||||||
result = {}
|
result = {}
|
||||||
elif mode == 'html':
|
elif mode == 'html':
|
||||||
result = BeautifulSoup(result, "html.parser")
|
result = BeautifulSoup(result, "html.parser")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user