fix(runtime): show transport failures in app error outlets
Make failed hemx requests visibly recoverable by updating root-scoped data-hemx-error outlets while preserving fail-closed non-2xx handling and inspectable hemx:error events. The v0 generated-app exemplar now includes a transport error outlet alongside generated field-error targets. req: runtime/005 req: examples/001 req: canonical_authoring/003
This commit is contained in:
@@ -23,6 +23,9 @@ fn runtime_reports_http_failures_without_applying_effects() {
|
||||
|
||||
assert!(source.contains("function httpError(response)"));
|
||||
assert!(source.contains("if (!response.ok) throw httpError(response)"));
|
||||
assert!(source.contains("showError(target, error)"));
|
||||
assert!(source.contains("showError(target, null)"));
|
||||
assert!(source.contains("Request failed (${error.status})"));
|
||||
assert!(source.contains("error.status = response.status"));
|
||||
assert!(source.contains(
|
||||
"emit(rootOf(target), \"hemx:error\", { message: String(error), status: error.status || null })"
|
||||
@@ -129,6 +132,8 @@ fn runtime_toggles_pending_conventions_around_requests() {
|
||||
assert!(source.contains("el.removeAttribute(\"aria-busy\")"));
|
||||
assert!(source.contains("toggleBusy(el, on)"));
|
||||
assert!(source.contains("function toggleIndicator(indicator, on)"));
|
||||
assert!(source.contains("data-hemx-error"));
|
||||
assert!(source.contains("function showError(el, error)"));
|
||||
assert!(source.contains("toggleIndicator(i, on)"));
|
||||
assert!(source.contains("indicator.hidden = state.hidden"));
|
||||
assert!(source.contains("el.hasAttribute(\"data-hemx-disable-while-pending\")"));
|
||||
|
||||
Reference in New Issue
Block a user