isHttpError
True for an HttpError, also across two copies of this package.
True for an HttpError, also across two copies of this package.
Import#
ts
import { isHttpError } from "@shadow-js/dusk";
Signature#
ts
function isHttpError(value: unknown): value is HttpError
Parameters#
| Name | Description |
|---|---|
value |
Any thrown value. |
Returns#
Whether value is an HTTP error.
Examples#
ts
try { await load(); } catch (error) { if (isHttpError(error)) return error.status; }