We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc38aea commit 77b70d9Copy full SHA for 77b70d9
1 file changed
kaizen/frontend/ui/src/components/EntityExplorer.tsx
@@ -32,8 +32,15 @@ export default function EntityExplorer() {
32
method: 'DELETE'
33
});
34
if (!res.ok) {
35
- const d = await res.json();
36
- throw new Error(d.detail || 'Failed to delete entity');
+ let errorMsg = `HTTP ${res.status} ${res.statusText}`;
+ const body = await res.text();
37
+ try {
38
+ const d = JSON.parse(body);
39
+ errorMsg = d.detail || errorMsg;
40
+ } catch {
41
+ if (body) errorMsg += `: ${body}`;
42
+ }
43
+ throw new Error(errorMsg);
44
}
45
refetch();
46
if (selectedEntity?.id === entityId) {
0 commit comments