From 5f4e00d87430464b16608a44d350a4743bb77449 Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Wed, 15 Jan 2025 21:24:41 -0500 Subject: [PATCH] Update axis_ptz_controller.py --- axis-ptz-controller/axis_ptz_controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/axis-ptz-controller/axis_ptz_controller.py b/axis-ptz-controller/axis_ptz_controller.py index 7a105b9..348f2e1 100644 --- a/axis-ptz-controller/axis_ptz_controller.py +++ b/axis-ptz-controller/axis_ptz_controller.py @@ -7,6 +7,8 @@ import ast from datetime import datetime import json +from json import JSONDecodeError + import math import logging import threading @@ -380,7 +382,7 @@ def decode_payload( try: json_payload = json.loads(payload) data_payload = json_payload[data_payload_type] - except (KeyError, TypeError) as e: + except (KeyError, TypeError, JSONDecodeError, json.JSONDecodeError) as e: logging.error(f"Error: {e}") logging.error(json_payload) logging.error(