In-page error reporting for component throws.
When a :render or :handle fn throws, the kernel and frame layers
catch here instead of letting the exception bubble into the SSE
handler. The conversation is left untouched; an :error fragment
patches a banner in place of the failing instance's DOM node so the
user sees what went wrong and can keep interacting with the page.
The optional :on-error hook configured on
dev.zeko.stube.embed/make-kernel is invoked with (conv throwable) and may return its own fragment to display instead of
the default banner. The throwable handed to the hook is wrapped in
an ex-info carrying :stube.error/iid and :stube.error/phase
(:render or :handle).
In-page error reporting for component throws. When a `:render` or `:handle` fn throws, the kernel and frame layers catch here instead of letting the exception bubble into the SSE handler. The conversation is left untouched; an `:error` fragment patches a banner in place of the failing instance's DOM node so the user sees what went wrong and can keep interacting with the page. The optional `:on-error` hook configured on [[dev.zeko.stube.embed/make-kernel]] is invoked with `(conv throwable)` and may return its own fragment to display instead of the default banner. The throwable handed to the hook is wrapped in an `ex-info` carrying `:stube.error/iid` and `:stube.error/phase` (`:render` or `:handle`).
Optional (fn [conv throwable]) returning a fragment to patch in
place of the failing instance. Bound by the runtime layer from
make-kernel's :on-error option.
Optional `(fn [conv throwable])` returning a fragment to patch in place of the failing instance. Bound by the runtime layer from `make-kernel`'s `:on-error` option.
(build-fragment conv iid throwable phase)Resolve the error fragment for an in-flight component failure.
Invokes *on-error* if installed; falls back to default-fragment.
Also logs the cid/iid/phase to stderr so production failures show up
in server logs.
Resolve the error fragment for an in-flight component failure. Invokes `*on-error*` if installed; falls back to [[default-fragment]]. Also logs the cid/iid/phase to stderr so production failures show up in server logs.
(default-fragment cid iid throwable phase)(default-fragment cid iid throwable phase opts)Build the stock error banner targeting iid. An HTML comment in
the patched markup carries the cid/iid/phase so the surface stays
identifiable in browser devtools.
Build the stock error banner targeting `iid`. An HTML comment in the patched markup carries the cid/iid/phase so the surface stays identifiable in browser devtools.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |