From 45bd04772e422541fb5380fdfa6593eeb54af29b Mon Sep 17 00:00:00 2001 From: James Panayis Date: Mon, 29 Jun 2026 06:32:42 +0100 Subject: [PATCH] Fix incorrect exception catching of json responses This caused issues when simplejson happened to be present, as this makes requests change its exception inheritance structure --- simvue/api/request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simvue/api/request.py b/simvue/api/request.py index f0eec567..89ab9555 100644 --- a/simvue/api/request.py +++ b/simvue/api/request.py @@ -326,7 +326,7 @@ def get_json_from_response( json_response = response.json() json_response = json_response or ({} if expected_type is dict else []) decode_error = "" - except json_module.JSONDecodeError as e: + except requests.exceptions.JSONDecodeError as e: json_response = {} if allow_parse_failure else None decode_error = f"{e}" @@ -419,7 +419,7 @@ def get_paginated( _response.json().get("count", 0) < _offset ): break - except json_module.JSONDecodeError: + except requests.exceptions.JSONDecodeError: raise RuntimeError( f"[{_response.status_code}] Failed to retrieve content from server: " + _response.text,