From 6c3b682ef0a16749dbed05409839cf595d2561a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Mon, 23 Nov 2020 03:21:01 +0100 Subject: [PATCH 1/3] Log HTTP 400 json payloads --- jellyfin_kodi/jellyfin/http.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jellyfin_kodi/jellyfin/http.py b/jellyfin_kodi/jellyfin/http.py index 866ac7f8..38893428 100644 --- a/jellyfin_kodi/jellyfin/http.py +++ b/jellyfin_kodi/jellyfin/http.py @@ -135,6 +135,14 @@ class HTTP(object): raise HTTPException("Unauthorized", error) + elif r.status_code == 400: + LOG.warning(error) + LOG.warning(data) + try: + LOG.warning(r.json()) + except Exception: + pass + elif r.status_code == 500: # log and ignore. LOG.error("--[ 500 response ] %s", error) From 8a9b69f2f520db8cbc32d1133cc92c3f2e260fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Mon, 23 Nov 2020 03:22:01 +0100 Subject: [PATCH 2/3] Remove extra leading slash from the KodiSyncQueue ping endpoint --- jellyfin_kodi/jellyfin/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jellyfin_kodi/jellyfin/api.py b/jellyfin_kodi/jellyfin/api.py index d1efceea..6771f682 100644 --- a/jellyfin_kodi/jellyfin/api.py +++ b/jellyfin_kodi/jellyfin/api.py @@ -259,7 +259,7 @@ class API(object): def check_companion_installed(self): try: - self._get("/Jellyfin.Plugin.KodiSyncQueue/GetServerDateTime") + self._get("Jellyfin.Plugin.KodiSyncQueue/GetServerDateTime") return True except Exception: return False From 146bd401bf80f441b8f3003c227ed227590029d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Wed, 25 Nov 2020 11:54:22 +0100 Subject: [PATCH 3/3] HTTP 400: Log response body when it can't be decoded as json --- jellyfin_kodi/jellyfin/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jellyfin_kodi/jellyfin/http.py b/jellyfin_kodi/jellyfin/http.py index 38893428..a3027ca4 100644 --- a/jellyfin_kodi/jellyfin/http.py +++ b/jellyfin_kodi/jellyfin/http.py @@ -141,7 +141,7 @@ class HTTP(object): try: LOG.warning(r.json()) except Exception: - pass + LOG.warning(r.text) elif r.status_code == 500: # log and ignore. LOG.error("--[ 500 response ] %s", error)