MCPcopy
hub / github.com/nestjs/nest / run

Method run

packages/core/errors/exceptions-zone.ts:9–23  ·  view source on GitHub ↗
(
    callback: () => void,
    teardown: (err: any) => void = DEFAULT_TEARDOWN,
    autoFlushLogs: boolean,
  )

Source from the content-addressed store, hash-verified

7 private static readonly exceptionHandler = new ExceptionHandler();
8
9 public static run(
10 callback: () => void,
11 teardown: (err: any) => void = DEFAULT_TEARDOWN,
12 autoFlushLogs: boolean,
13 ) {
14 try {
15 callback();
16 } catch (e) {
17 this.exceptionHandler.handle(e);
18 if (autoFlushLogs) {
19 Logger.flush();
20 }
21 teardown(e);
22 }
23 }
24
25 public static async asyncRun(
26 callback: () => Promise<void>,

Callers 6

createExceptionZoneMethod · 0.80
interceptMethod · 0.80
runMiddieFunction · 0.80
bindTopicsMethod · 0.80
bindEventsMethod · 0.80

Calls 3

flushMethod · 0.80
handleMethod · 0.65
callbackFunction · 0.50

Tested by 1

interceptMethod · 0.64