From 34f5aa97edc87af1677fe32e8d9e8a6fc9cb4f20 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 25 Jan 2022 20:00:25 +0000 Subject: [PATCH] Add more error handling to AgoraDesk library --- handler/agoradesk_py.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handler/agoradesk_py.py b/handler/agoradesk_py.py index fdf1988..87b0752 100644 --- a/handler/agoradesk_py.py +++ b/handler/agoradesk_py.py @@ -114,6 +114,12 @@ class AgoraDesk: result["status"] = response.status_code result["response"] = {"error": {"message": response.text}} return result + except httpx.ReadTimeout: + result["message"] = "Read timed out" + if response: + result["status"] = response.status_code + result["response"] = {"error": {"message": response.text}} + return result # Account related API Methods # ===========================