18 lines
535 B
TypeScript
18 lines
535 B
TypeScript
|
|
import { configureErrorHandler, handleError } from '@lumina/libs/error-handler';
|
||
|
|
import type { Instrumentation } from 'next';
|
||
|
|
|
||
|
|
import { ERROR_HANDLER_CONFIG } from './bootstrap/error-reporting';
|
||
|
|
|
||
|
|
export function register(): void {
|
||
|
|
configureErrorHandler(ERROR_HANDLER_CONFIG);
|
||
|
|
}
|
||
|
|
|
||
|
|
/** Reports what no server code caught, once, with the route it happened on. */
|
||
|
|
export const onRequestError: Instrumentation.onRequestError = (
|
||
|
|
error,
|
||
|
|
_request,
|
||
|
|
context,
|
||
|
|
) => {
|
||
|
|
handleError(error, { where: 'server', name: context.routePath });
|
||
|
|
};
|