(errorCode, errorContext)
| 130 | req.res = res; |
| 131 | |
| 132 | const callback = (errorCode, errorContext) => { |
| 133 | if (errorCode !== undefined) { |
| 134 | this.emit("connection_error", { |
| 135 | req, |
| 136 | code: errorCode, |
| 137 | message: Server.errorMessages[errorCode], |
| 138 | context: errorContext, |
| 139 | }); |
| 140 | this.abortRequest(req.res, errorCode, errorContext); |
| 141 | return; |
| 142 | } |
| 143 | |
| 144 | if (req._query.sid) { |
| 145 | debug("setting new request for existing client"); |
| 146 | // @ts-ignore |
| 147 | this.clients[req._query.sid].transport.onRequest(req); |
| 148 | } else { |
| 149 | const closeConnection = (errorCode, errorContext) => |
| 150 | this.abortRequest(res, errorCode, errorContext); |
| 151 | this.handshake( |
| 152 | req._query.transport, |
| 153 | req as unknown as EngineRequest, |
| 154 | closeConnection, |
| 155 | ); |
| 156 | } |
| 157 | }; |
| 158 | |
| 159 | this._applyMiddlewares(req, res, (err) => { |
| 160 | if (err) { |
nothing calls this directly
no test coverage detected