useAsync wraps an arbitrary async function, not just FetchEngine calls,
so unlike FetchFailure it cannot promise a FetchError on rejection —
all it truly knows is that something was thrown. kind: 'http' still
narrows precisely when the resolved value structurally looks like a
non-2xx response.
kind: 'rejected' (not 'transport') is deliberate: FetchFailure's
'transport' means "no response exists, and it came from a FetchEngine
call" — a promise from an arbitrary async function that isn't hitting an
HTTP endpoint has no "transport" at all, so labeling its rejection
'transport' would lie about what actually happened. 'rejected' names
only what's true for any wrapped function: the promise rejected.
useAsyncwraps an arbitrary async function, not just FetchEngine calls, so unlikeFetchFailureit cannot promise aFetchErroron rejection — all it truly knows is that something was thrown.kind: 'http'still narrows precisely when the resolved value structurally looks like a non-2xx response.kind: 'rejected'(not'transport') is deliberate:FetchFailure's'transport'means "no response exists, and it came from a FetchEngine call" — a promise from an arbitrary async function that isn't hitting an HTTP endpoint has no "transport" at all, so labeling its rejection'transport'would lie about what actually happened.'rejected'names only what's true for any wrapped function: the promise rejected.