Created by: rowanmanning
This would allow someone to differentiate between client errors and target server errors in their proxy error handling, by inspecting the error request property.
I'm not sure if this is how you'd prefer to do this, open to alternatives. The problem I'm trying to solve is in a proxy service I maintain – I'd like to differentiate between client and server errors in our logging.
This is a potential solution for #1017. E.g:
proxy.on('error', (error, request, response, url) => {
// Will log either "target" or "forward"
console.log(`Error came from ${error.request.proxyRequestType}`);
});