ActionFailure (@shadow-js/dusk/server)
A failure returned by a server function with fail: the call succeeded and answers with a status and data (typically field problems) for the page to show. (ActionFailure of @shadow-js/dusk/server)
A failure returned by a server function with fail: the call succeeded and answers with a status and data (typically field problems) for the page to show.
Import#
ts
import type { ActionFailure } from "@shadow-js/dusk/server";
Signature#
ts
interface ActionFailure<Data = unknown> {
/** The brand: `1`. */
readonly __duskFailure: 1;
/** The HTTP status the failure stands for (400 to 599). */
readonly status: number;
/** What the page shows: field problems, a message, anything JSON-able. */
readonly data: Data;
}
Members#
| Name | Type | Description |
|---|---|---|
Data |
Data = unknown |
|
status |
readonly status: number |
The HTTP status the failure stands for (400 to 599). |
data |
readonly data: Data |
What the page shows: field problems, a message, anything JSON-able. |