Add more error handling to AgoraDesk library

This commit is contained in:
Mark Veidemanis 2022-01-25 20:00:25 +00:00
parent 1e685c9f8d
commit 2f0cb38abd
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 6 additions and 0 deletions

View File

@ -114,6 +114,12 @@ class AgoraDesk:
result["status"] = response.status_code result["status"] = response.status_code
result["response"] = {"error": {"message": response.text}} result["response"] = {"error": {"message": response.text}}
return result 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 # Account related API Methods
# =========================== # ===========================