Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the user request available in proxyErrorHandler #483

Open
regosen opened this issue May 24, 2021 · 0 comments
Open

Make the user request available in proxyErrorHandler #483

regosen opened this issue May 24, 2021 · 0 comments

Comments

@regosen
Copy link

regosen commented May 24, 2021

I'd like to use proxyErrorHandler to log errors for me, but currently it only provides the error, response, and next. I see that req is available in the function handleProxy, it just needs to be fed into resolver.

Alternatively, if there's a recommended way to access the request in the error handler I'm all ears. I'm using it like this:

const myApp = express();
myApp.use('/proxiedRequest', myMiddleware(), proxy('http://target.host.com', {
  proxyErrorHandler: (err, res, next) => {
    // TODO: report failure, including request url, headers, etc.
    next(err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant