From da42de5466fdc0a882306add652dc1fd4f249a5fb1fabbd04a74aff45a269341 Mon Sep 17 00:00:00 2001 From: PioApocalypse Date: Thu, 12 Feb 2026 23:52:37 +0100 Subject: [PATCH] handles error 400 bad request with exit message --- src/APIHandler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/APIHandler.py b/src/APIHandler.py index 3bcef72..414772d 100644 --- a/src/APIHandler.py +++ b/src/APIHandler.py @@ -33,6 +33,8 @@ class APIHandler: raise ConnectionError(f"Invalid API key or authentication method.") case 404: raise ConnectionError(f"404: Not Found. This means there's no resource with this elabid (wrong elabid?) on your eLabFTW (wrong endpoint?).") + case 400: + raise ConnectionError(f"400: Bad Request. This means the API endpoint you tried to reach is invalid. Did you tamper with the source code? If not, contact the developer.") case _: raise ConnectionError(f"HTTP request failed with status code: {response.status_code} (NOTE: 4xx means user's fault).") else: