Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Merge requests
  • !1172

Store the request object in proxy errors

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/rowanmanning/proxy-error-request into master May 23, 2017
  • Overview 3
  • Commits 1
  • Pipelines 1
  • Changes 2

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}`);
});
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/rowanmanning/proxy-error-request