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";Código fuente src/server/errors.ts:244
Declaración #
ts
type ServerErrorObserver = (error: unknown, requestId: string, info?: ServerErrorInfo) => voidEjemplo #
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);
};