esabora: fix catching of json errors (#72572) #12

Merged
fpeters merged 1 commits from wip/72572-esabora-jsondecodeerror into main 2022-12-19 09:20:35 +01:00
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import json
import urllib.parse
import requests
@ -85,7 +86,7 @@ class Esabora(BaseResource, HTTPResource):
)
try:
data = response.json()
except requests.JSONDecodeError as e:
except json.JSONDecodeError as e:
raise APIError(
'Esabora platform "%s" invalid JSON response: %s' % (self.service_url, exception_to_text(e)),
log_error=True,