express-http-proxy
express-http-proxy copied to clipboard
Documentation clarification needed for proxyErrorHandler
One thing isn't super clear in the docs. For the proxyErrorHandler section it says:
By default, express-http-proxy will pass any errors except ECONNRESET to next, so that your application can handle or react to them, or just drop through to your default error handling. ECONNRESET errors are immediately returned to the user for historical reasons.
If you would like to modify this behavior, you can provide your own proxyErrorHandler.
What isn't clear is whether you can bypass that ECONNRESET behavior by providing a custom proxyErrorHandler or if you can only customize error handling for everything but ECONNRESET.
Would even ECONNRESET be passed through the middleware chain if you have this?
const expressHttpProxy = require('express-http-proxy');
const proxy = ('example.com', {
proxyErrorHandler: (err, res, next) => void next(err)
});