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
  • Issues
  • #813
Closed
Open
Issue created Apr 27, 2015 by Administrator@rootContributor

How can I filter socket hang up errors?

Created by: JSteunou

I'm using node-http-proxy for a while now, and I think I'm using it quite right catching errors like this

proxy.on('error', function(err, req, res) {
    // log
    // ...
    // handle
    if (!res.headersSent) {
        res.writeHead(500, { 'content-type': 'application/json' });
    }
    res.end(JSON.stringify({ error: 'proxy_error', reason: err.message }));
});

But I can have two cases that make a "socket hang up" error happen.

  1. Crash behind
  2. Client cancelling the request

Watching at my log I can make no differences between those two cases and it's quite frustrating. Before knowing about request abort (thank #527 (closed)) I really though I have an error going on.

So, what's the best practice to filter the request.abort case out?

Assignee
Assign to
Time tracking