* Handles `unhandledRejection` events for the current process by adding any * handlers passed in. * @returns {undefined}
(...args)
| 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 |
no test coverage detected