mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
feat: mv response.json() in try
This commit is contained in:
parent
bbc943fa6b
commit
a253241b56
|
@ -236,12 +236,12 @@ class KanidmUserRepository(AbstractUserRepository):
|
||||||
timeout=1,
|
timeout=1,
|
||||||
verify=False, # TODO: REMOVE THIS NOT HALAL!!!!!
|
verify=False, # TODO: REMOVE THIS NOT HALAL!!!!!
|
||||||
)
|
)
|
||||||
|
response_data = response.json()
|
||||||
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.error(f"Kanidm query error: {str(error)}")
|
logger.error(f"Kanidm query error: {str(error)}")
|
||||||
raise KanidmQueryError(error_text=str(error))
|
raise KanidmQueryError(error_text=str(error))
|
||||||
|
|
||||||
response_data = response.json()
|
|
||||||
|
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
if isinstance(response_data, dict):
|
if isinstance(response_data, dict):
|
||||||
plugin_error = response_data.get("plugin", {})
|
plugin_error = response_data.get("plugin", {})
|
||||||
|
|
Loading…
Reference in a new issue