Skip to content

Commit 13d3220

Browse files
authored
Merge pull request #196 from jooola/fix_json_decode_error
fix: catch ValueError during json parsing
2 parents ed02622 + d2412dc commit 13d3220

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pyzabbix/api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from packaging.version import Version
88
from requests import Session
9-
from requests.exceptions import JSONDecodeError
109

1110
__all__ = [
1211
"ZabbixAPI",
@@ -218,7 +217,7 @@ def do_request(
218217

219218
try:
220219
response = resp.json()
221-
except JSONDecodeError as exception:
220+
except ValueError as exception:
222221
raise ZabbixAPIException(
223222
f"Unable to parse json: {resp.text}"
224223
) from exception

0 commit comments

Comments
 (0)