* Helper method to add a transport as an exception handler. * @param {Transport} handler - The transport to add as an exception handler. * @returns {void}
(handler)
| 149 | * @returns {void} |
| 150 | */ |
| 151 | _addHandler(handler) { |
| 152 | if (!this.handlers.has(handler)) { |
| 153 | handler.handleRejections = true; |
| 154 | const wrapper = new RejectionStream(handler); |
| 155 | this.handlers.set(handler, wrapper); |
| 156 | this.logger.pipe(wrapper); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * Logs all relevant information around the `err` and exits the current |