[]previous and next page

HttpErrorOptions

Options of HttpError.

Options of HttpError.

Import#

ts
import type { HttpErrorOptions } from "@shadow-js/dusk";

Signature#

ts
interface HttpErrorOptions {
  /** Extra response headers, for example `WWW-Authenticate` or `Retry-After`. */
  readonly headers?: HeadersInit;
  /** Serializable detail that is sent to the client together with the error. */
  readonly data?: unknown;
  /** The underlying error. Never sent to the client. */
  readonly cause?: unknown;
  /**
   * Whether `message` may be shown to the client. Defaults to `true` for 4xx and `false` for 5xx,
   * where the message is replaced by the status text in production.
   */
  readonly expose?: boolean;
}

Members#

Name Type Description
headers? readonly headers?: HeadersInit Extra response headers, for example WWW-Authenticate or Retry-After.
data? readonly data?: unknown Serializable detail that is sent to the client together with the error.
cause? readonly cause?: unknown The underlying error. Never sent to the client.
expose? readonly expose?: boolean Whether message may be shown to the client. Defaults to true for 4xx and false for 5xx, where the message is replaced by the status text in production.