MCPcopy
hub / github.com/winstonjs/winston / handle

Method handle

lib/winston/rejection-handler.js:40–53  ·  view source on GitHub ↗

* Handles `unhandledRejection` events for the current process by adding any * handlers passed in. * @returns {undefined}

(...args)

Source from the content-addressed store, hash-verified

38 * @returns {undefined}
39 */
40 handle(...args) {
41 args.forEach(arg => {
42 if (Array.isArray(arg)) {
43 return arg.forEach(handler => this._addHandler(handler));
44 }
45
46 this._addHandler(arg);
47 });
48
49 if (!this.catcher) {
50 this.catcher = this._unhandledRejection.bind(this);
51 process.on('unhandledRejection', this.catcher);
52 }
53 }
54
55 /**
56 * Removes any handlers to `unhandledRejection` events for the current

Callers 10

configureMethod · 0.45
addMethod · 0.45
handleExceptionsMethod · 0.45
handler-tests.jsFile · 0.45
log-rejections.jsFile · 0.45

Calls 1

_addHandlerMethod · 0.95

Tested by

no test coverage detected