{"action":"closed","issue":{"url":"https://api.github.com/repos/visionmedia/superagent/issues/410","labels_url":"https://api.github.com/repos/visionmedia/superagent/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/visionmedia/superagent/issues/410/comments","events_url":"https://api.github.com/repos/visionmedia/superagent/issues/410/events","html_url":"https://github.com/visionmedia/superagent/issues/410","id":37209267,"number":410,"title":"Unpossible to handle the error from zlib","user":{"login":"kof","id":52824,"avatar_url":"https://avatars.githubusercontent.com/u/52824?v=3","gravatar_id":"","url":"https://api.github.com/users/kof","html_url":"https://github.com/kof","followers_url":"https://api.github.com/users/kof/followers","following_url":"https://api.github.com/users/kof/following{/other_user}","gists_url":"https://api.github.com/users/kof/gists{/gist_id}","starred_url":"https://api.github.com/users/kof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kof/subscriptions","organizations_url":"https://api.github.com/users/kof/orgs","repos_url":"https://api.github.com/users/kof/repos","events_url":"https://api.github.com/users/kof/events{/privacy}","received_events_url":"https://api.github.com/users/kof/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-07-06T01:04:21Z","updated_at":"2015-02-22T04:02:58Z","closed_at":"2015-02-22T04:02:58Z","body":"The error I get from zlib\r\n\r\nError: unknown compression method\r\n    at Zlib._binding.onerror (zlib.js:361:17)\r\n{ errno: -3, code: 'Z_DATA_ERROR' }\r\n\r\n\r\nBut the real problem is that I can't handle it.\r\n\r\n\r\nutils.unzip overrides res.on method to attach handlers on zlib stream, however in combination with streaming interface, utils.unzip(req, res) is called before 'response' event is triggered to the user instance, so I get the access to the res object after the error is already triggered.\r\n\r\n\r\nDoes this need a reproducible example?"}}