esabora: fix catching of json errors (#72572)
gitea-wip/passerelle/pipeline/pr-main This commit looks good Details
gitea-wip/passerelle/pipeline/head Build started... Details
gitea/passerelle/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Frédéric Péters 2022-12-17 18:56:50 +01:00
parent 64ef32a922
commit db49dab374
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,