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

Don't add interceptor (error middleware) to Express Route's stack #207

Closed
wants to merge 1 commit into from

Commits on Feb 21, 2016

  1. Don't add interceptor (error middleware) to Routes stack

    The current problem is that the error middleware that new relic adds to the main stack is also being added to every Router method's stack.
    This means that the error middleware is actually being run twice, once from the Router method's stack and once from the general stack.
    Besides this being wrong the other problem is that the cleanup function (line 398) that runs after the first error middleware finished removes the partialName thus causing the errors in new relic to appear without the specific url. it will only show '/' in the Errors view because of the cleanup.
    The solution is to not add the error middleware for Router stacks. Add it only for the main stack.
    itai-codefresh committed Feb 21, 2016
    Configuration menu
    Copy the full SHA
    c009ec8 View commit details
    Browse the repository at this point in the history