MCPcopy Create free account
hub / github.com/evolution-foundation/evolution-api / onUnexpectedError

Function onUnexpectedError

src/config/error.config.ts:3–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { Logger } from './logger.config';
2
3export function onUnexpectedError() {
4 process.on('uncaughtException', (error, origin) => {
5 const logger = new Logger('uncaughtException');
6 logger.error({
7 origin,
8 stderr: process.stderr.fd,
9 error,
10 });
11 });
12
13 process.on('unhandledRejection', (error, origin) => {
14 const logger = new Logger('unhandledRejection');
15 logger.error({
16 origin,
17 stderr: process.stderr.fd,
18 });
19 logger.error(error);
20 });
21}

Callers 1

bootstrapFunction · 0.90

Calls 1

errorMethod · 0.95

Tested by

no test coverage detected