feat: mv response.json() in try

This commit is contained in:
dettlaff 2024-12-13 07:06:34 +04:00
parent bbc943fa6b
commit a253241b56

View file

@ -236,12 +236,12 @@ class KanidmUserRepository(AbstractUserRepository):
timeout=1,
verify=False, # TODO: REMOVE THIS NOT HALAL!!!!!
)
response_data = response.json()
except Exception as error:
logger.error(f"Kanidm query error: {str(error)}")
raise KanidmQueryError(error_text=str(error))
response_data = response.json()
if response.status_code != 200:
if isinstance(response_data, dict):
plugin_error = response_data.get("plugin", {})