fix(ui): use describeApiError across remaining error-surface sites
Extends the previous describeApiError rollout to the rest of the UI.
Two symptom classes covered:
- Bare e.message / err.message in toast descriptions would render
"undefined" on Spring error bodies (plain objects without a proper
Error prototype). Affected: OidcConfigPage (save/test/delete),
ClaimMappingRulesModal (save + test), AgentHealth (dismiss),
RouteControlBar (route action + replay).
- Inline {String(error)} on load-failure banners would render
"[object Object]". Affected: InboxPage, RulesListPage, SilencesPage,
OutboundConnectionsPage.
Not touched: auth-store, AppsTab, UsersTab — they already guard with
`e instanceof Error` and fall back to a static string; replacing the
fallback with describeApiError would be a behavioral change best
evaluated separately.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import type { ConfigUpdateResponse } from '../../api/queries/commands';
|
||||
import type { AgentInstance } from '../../api/types';
|
||||
import { timeAgo } from '../../utils/format-utils';
|
||||
import { formatUptime, mapLogLevel, eventSeverity, eventIcon } from '../../utils/agent-utils';
|
||||
import { describeApiError } from '../../api/errors';
|
||||
|
||||
// ── Helpers ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -506,7 +507,7 @@ export default function AgentHealth() {
|
||||
navigate('/runtime');
|
||||
},
|
||||
onError: (err) => {
|
||||
toast({ title: 'Dismiss failed', description: err.message, variant: 'error', duration: 86_400_000 });
|
||||
toast({ title: 'Dismiss failed', description: describeApiError(err), variant: 'error', duration: 86_400_000 });
|
||||
},
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user