{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/highland/issues/257","labels_url":"https://api.github.com/repos/caolan/highland/issues/257/labels{/name}","comments_url":"https://api.github.com/repos/caolan/highland/issues/257/comments","events_url":"https://api.github.com/repos/caolan/highland/issues/257/events","html_url":"https://github.com/caolan/highland/issues/257","id":65064619,"number":257,"title":"How to stream error ?","user":{"login":"asafyish","id":1331750,"avatar_url":"https://avatars.githubusercontent.com/u/1331750?v=3","gravatar_id":"","url":"https://api.github.com/users/asafyish","html_url":"https://github.com/asafyish","followers_url":"https://api.github.com/users/asafyish/followers","following_url":"https://api.github.com/users/asafyish/following{/other_user}","gists_url":"https://api.github.com/users/asafyish/gists{/gist_id}","starred_url":"https://api.github.com/users/asafyish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asafyish/subscriptions","organizations_url":"https://api.github.com/users/asafyish/orgs","repos_url":"https://api.github.com/users/asafyish/repos","events_url":"https://api.github.com/users/asafyish/events{/privacy}","received_events_url":"https://api.github.com/users/asafyish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-29T14:07:45Z","updated_at":"2015-03-29T20:18:52Z","closed_at":null,"body":"Hi,\r\nWe have a use case when we want to send an error on a highland stream, and catch it on the side in the err parameter, using a copied StreamError works correctly, otherwise it doesn't. For example:\r\n\r\n```js\r\nfunction StreamError(err) {\r\n    this.__HighlandStreamError__ = true;\r\n    this.error = err;\r\n}\r\n\r\nvar stream = getStreamSomeWhere();\r\n\r\nstream.end(new StreamError('something went wrong');\r\nstream.pull(function(err, data) {\r\n// err = 'something went wrong', like expected\r\n});\r\n```\r\n\r\nIs there other why to achieve the same result without using a fake StreamError ?"},"comment":{"url":"https://api.github.com/repos/caolan/highland/issues/comments/87468866","html_url":"https://github.com/caolan/highland/issues/257#issuecomment-87468866","issue_url":"https://api.github.com/repos/caolan/highland/issues/257","id":87468866,"user":{"login":"vqvu","id":6435429,"avatar_url":"https://avatars.githubusercontent.com/u/6435429?v=3","gravatar_id":"","url":"https://api.github.com/users/vqvu","html_url":"https://github.com/vqvu","followers_url":"https://api.github.com/users/vqvu/followers","following_url":"https://api.github.com/users/vqvu/following{/other_user}","gists_url":"https://api.github.com/users/vqvu/gists{/gist_id}","starred_url":"https://api.github.com/users/vqvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vqvu/subscriptions","organizations_url":"https://api.github.com/users/vqvu/orgs","repos_url":"https://api.github.com/users/vqvu/repos","events_url":"https://api.github.com/users/vqvu/events{/privacy}","received_events_url":"https://api.github.com/users/vqvu/received_events","type":"User","site_admin":false},"created_at":"2015-03-29T20:18:52Z","updated_at":"2015-03-29T20:18:52Z","body":"Also, your code sample doesn't make sense. `Highland#end` doesn't take an argument. If `stream` isn't a highland stream, why does `pull` exist?"}}