Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

ApiErrorOptions

interfaz Since 1.5.0

Tercer argumento de ApiError con opciones.

ts
import type { ApiErrorOptions } from "@meekojs/meeko/server";

Source code src/server/errors.ts:95

Declaración #

ts
interface ApiErrorOptions {
	readonly message?: string
	readonly issues?: readonly ApiErrorIssue[]
}

Example #

ts
import { ApiError } from "@meekojs/meeko/server";
import type { ApiErrorOptions } from "@meekojs/meeko/server";
const options: ApiErrorOptions = { message: "duplicate key users_email", issues: [{ path: "email", message: "Ese correo ya existe." }] };
throw new ApiError("EMAIL_TAKEN", 409, options);

Propiedades #

message #

propiedad sólo lectura opcional

readonly message?: string

Mensaje interno; no se envía al cliente. Por defecto, el código.

issues #

propiedad sólo lectura opcional

readonly issues?: readonly ApiErrorIssue[]

Mensajes públicos por campo, que el cliente recibe en ClientError.issues.

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/errors.ts