MCPcopy
hub / github.com/http-party/node-http-proxy / createErrorHandler

Function createErrorHandler

lib/http-proxy/passes/web-incoming.js:155–168  ·  view source on GitHub ↗
(proxyReq, url)

Source from the content-addressed store, hash-verified

153 proxyReq.on('error', proxyError);
154
155 function createErrorHandler(proxyReq, url) {
156 return function proxyError(err) {
157 if (req.socket.destroyed && err.code === 'ECONNRESET') {
158 server.emit('econnreset', err, req, res, url);
159 return proxyReq.abort();
160 }
161
162 if (clb) {
163 clb(err, req, res, url);
164 } else {
165 server.emit('error', err, req, res, url);
166 }
167 }
168 }
169
170 (options.buffer || req).pipe(proxyReq);
171

Callers 1

web-incoming.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected