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.

ServerErrorObserver

tipo

Observador de los fallos internos del servidor, con el ID de la petición. Su propio fallo no cambia la respuesta. Desde 1.3, los fallos del proceso (promesas rechazadas sin manejar y excepciones no capturadas) llegan con un tercer argumento, ServerErrorInfo.

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

Source code src/server/errors.ts:244

Declaración #

ts
type ServerErrorObserver = (error: unknown, requestId: string, info?: ServerErrorInfo) => void

Example #

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

export const onError: ServerErrorObserver = (error, requestId, info) => {
  const where = info ? info.kind : "request";
  console.error(`[${where} ${requestId}]`, error instanceof Error ? error.name : typeof error);
};

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