* Called with a transport error. * * @param {String} msg - message error * @param {Object} desc - error description * @protected
(msg: string, desc?)
| 133 | * @protected |
| 134 | */ |
| 135 | protected onError(msg: string, desc?) { |
| 136 | if (this.listeners("error").length) { |
| 137 | const err = new Error(msg); |
| 138 | // @ts-ignore |
| 139 | err.type = "TransportError"; |
| 140 | // @ts-ignore |
| 141 | err.description = desc; |
| 142 | this.emit("error", err); |
| 143 | } else { |
| 144 | debug("ignored transport error %s (%s)", msg, desc); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Called with parsed out a packets from the data stream. |
no test coverage detected