From b07a3f1a6e41ce3217990f74cca13dc0c63b7533 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 16 Nov 2024 20:28:53 +0200 Subject: [PATCH] Add sending message of error to delete handler for entities proxy requests --- src/lib/entities.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/entities.ts b/src/lib/entities.ts index 789f400..e850cde 100644 --- a/src/lib/entities.ts +++ b/src/lib/entities.ts @@ -173,7 +173,8 @@ export async function remove(groupName: string, id: number, session?: string): P try { const response = await fetch(url, config); if (!response.ok) { - throw new Error(`Failed to delete ${groupName}: ${response.statusText}`); + const body = await response.json() + throw new Error(`Failed to delete ${groupName}: ${body.message}`); } return await response.json() as Message; } catch (err) {