Add sending message of error to delete handler for entities proxy requests
This commit is contained in:
parent
5566d1f78f
commit
b07a3f1a6e
|
@ -173,7 +173,8 @@ export async function remove(groupName: string, id: number, session?: string): P
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url, config);
|
const response = await fetch(url, config);
|
||||||
if (!response.ok) {
|
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;
|
return await response.json() as Message;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user