From 51090f05666e610c0f086557dbe673931cc09c90 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Wed, 28 Aug 2024 11:02:06 +0100 Subject: [PATCH] fix: Include raw body in ApiError messages --- flat-manager-client | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flat-manager-client b/flat-manager-client index c45d4b6..73f6a32 100755 --- a/flat-manager-client +++ b/flat-manager-client @@ -58,7 +58,11 @@ class ApiError(Exception): try: self.body = json.loads(body) except (json.JSONDecodeError, TypeError): - self.body = {"status": self.status, "error-type": "no-error", "message": "No json error details from server"} + self.body = { + "status": self.status, + "error-type": "no-error", + "message": f"Non-json error from server: {body}", + } def repr(self): return {