Skip to content

Commit

Permalink
Merge pull request #196 from jooola/fix_json_decode_error
Browse files Browse the repository at this point in the history
fix: catch ValueError during json parsing
  • Loading branch information
jooola authored Aug 4, 2022
2 parents ed02622 + d2412dc commit 13d3220
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pyzabbix/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from packaging.version import Version
from requests import Session
from requests.exceptions import JSONDecodeError

__all__ = [
"ZabbixAPI",
Expand Down Expand Up @@ -218,7 +217,7 @@ def do_request(

try:
response = resp.json()
except JSONDecodeError as exception:
except ValueError as exception:
raise ZabbixAPIException(
f"Unable to parse json: {resp.text}"
) from exception
Expand Down

0 comments on commit 13d3220

Please sign in to comment.