@jsenv/navi 0.29.161 → 0.29.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jsenv_navi.js +2139 -2032
- package/dist/jsenv_navi.js.map +15 -15
- package/docs/error_handling.md +18 -0
- package/docs/offline.md +7 -0
- package/package.json +1 -1
package/docs/error_handling.md
CHANGED
|
@@ -256,6 +256,24 @@ finds a boundary that displays it, or reaches window on its own, since
|
|
|
256
256
|
render loudly. Reporting it here too would be a second voice, and the wrong one:
|
|
257
257
|
this module cannot see which of those happened.
|
|
258
258
|
|
|
259
|
+
**And a render stopped in the middle read nothing after it.** `useAsyncData`
|
|
260
|
+
delegates a failure by throwing it out of the render — that is how the error
|
|
261
|
+
reaches the boundary. The render ends on that line, so a second `useAsyncData`
|
|
262
|
+
below it, even one asking for `error: true`, is never called and never claims
|
|
263
|
+
its own error. "Nobody read it" would then be true and meaningless: the order of
|
|
264
|
+
two hook calls would decide whether the app is told it has a bug. So the throw
|
|
265
|
+
speaks for the failures waiting for the same answer alongside it — a url change
|
|
266
|
+
fails its route actions together — and none of them is reported. What is on
|
|
267
|
+
screen is the failure the render was stopped at, which is the same story. A
|
|
268
|
+
failure arriving _later_, after the page was replaced by what displays the first
|
|
269
|
+
one, is not covered: nothing tells it apart from an action nobody reads.
|
|
270
|
+
|
|
271
|
+
One error is never reported whoever looks at it: an **`OfflineError`**. The app
|
|
272
|
+
declared the state that produced it and the request never left, so there is no
|
|
273
|
+
bug to point at — it is data a screen shows. navi also cancels the window
|
|
274
|
+
`error` event that displaying it produces in dev, which keeps the browser
|
|
275
|
+
console and the jsenv overlay out of it ([offline.md](./offline.md)).
|
|
276
|
+
|
|
259
277
|
So what reaches the report is an error **nothing looked at** — an action nobody
|
|
260
278
|
reads, a prerun for a page never opened. And _when_ it is reported follows from
|
|
261
279
|
that:
|
package/docs/offline.md
CHANGED
|
@@ -78,6 +78,13 @@ depends on what was asked:
|
|
|
78
78
|
`reason` is the policy's value. `isOfflineError(error)` tells it apart from a
|
|
79
79
|
request that left and never came back — that one is the app's `fetch`
|
|
80
80
|
rejecting, and the app names it.
|
|
81
|
+
|
|
82
|
+
It is an error only in the way it travels. Nothing treats it as a bug: navi
|
|
83
|
+
never reports it as unhandled, and the window `error` event a boundary's
|
|
84
|
+
display produces in dev is cancelled, so neither the browser console nor the
|
|
85
|
+
jsenv overlay says anything. The person reads the screen; nobody else has to
|
|
86
|
+
hear about it.
|
|
87
|
+
|
|
81
88
|
- **A write is refused before the press.** A control bound to a `POST`, `PUT`,
|
|
82
89
|
`PATCH` or `DELETE` action — or any control inside a `<Form>` bound to one —
|
|
83
90
|
is read-only while the policy holds, and answers the press with
|