{"action":"closed","issue":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/766","labels_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/766/labels{/name}","comments_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/766/comments","events_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/766/events","html_url":"https://github.com/petkaantonov/bluebird/issues/766","id":106812498,"number":766,"title":"Expose subError to make it easy to create new Error types","user":{"login":"kevinsimper","id":1126497,"avatar_url":"https://avatars.githubusercontent.com/u/1126497?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinsimper","html_url":"https://github.com/kevinsimper","followers_url":"https://api.github.com/users/kevinsimper/followers","following_url":"https://api.github.com/users/kevinsimper/following{/other_user}","gists_url":"https://api.github.com/users/kevinsimper/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinsimper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinsimper/subscriptions","organizations_url":"https://api.github.com/users/kevinsimper/orgs","repos_url":"https://api.github.com/users/kevinsimper/repos","events_url":"https://api.github.com/users/kevinsimper/events{/privacy}","received_events_url":"https://api.github.com/users/kevinsimper/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-16T16:41:05Z","updated_at":"2015-10-27T15:34:29Z","closed_at":"2015-10-27T15:34:29Z","body":"I am new to Promises, and I often use Promise.OperationalError, so I can catch that type easier, instead of in the catch function.\r\n\r\nI searched with google, but have not found any information where they use a flow with multiple error types, but often in my promise chains, there can happen errors, that are non-recoverable, but needs different answers.\r\n\r\nFor example a http route in express, could have three response, 500, 404, or 401 unauthorize.\r\n\r\nWould it be a idea to expose `subError` to make it possible to create new error types and then be able to use it later `.error(NotFound, func)`?"}}