fix(embedder_ui): show real errors when backend rpc.sock is unavailable #22
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_embedder!22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_ui_error_handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #20. Embedder dashboard panels now show clear inline error alerts when the backend rpc.sock is unavailable, instead of an opaque infinite "Loading..." with a cryptic JS console error.
Two coordinated changes in
hero_embedder_uitemplates:rpcCallvalidatesresponse.okandContent-Typebeforeawait response.json(). Non-OK + non-JSON responses (e.g.hero_router'stext/plain404 with bodySocket 'rpc.sock' not found for 'hero_embedder') now throwError("Backend unavailable (HTTP <status>): <body[:200]>")instead ofSyntaxError: Unexpected token 'S'.renderPanelError(containerId, message)helper instead ofconsole.error-and-forget. The namespace dropdown becomes a single disabledNamespaces unavailable: ...option. Recovery on next successful poll is automatic via the existinginnerHTML/outerHTMLrewrites;#loader-erroris cleared on everyrefreshLoaderStateentry.Includes a small XSS-safe
escapeHtmlhelper used byrenderPanelError. The dropdown usestextContentand is therefore also safe.Verified end-to-end in a headless browser against the live
hero_router404 path; browser console reported zero errors after the fix.Test plan
cargo check --workspace --binscleanNamespaces unavailable: ...option#loader-error; form remains renderedUnexpected tokenSyntaxError)hero_embedder_servercan start (blocked locally by missing ONNX runtime / models — environmental, out of scope; recovery is structurally guaranteed by the existing success-path DOM rewrites)