{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/hapi/issues/2597","labels_url":"https://api.github.com/repos/hapijs/hapi/issues/2597/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/hapi/issues/2597/comments","events_url":"https://api.github.com/repos/hapijs/hapi/issues/2597/events","html_url":"https://github.com/hapijs/hapi/issues/2597","id":87753760,"number":2597,"title":"errors not being thrown and app just stalling","user":{"login":"aschmid","id":143038,"avatar_url":"https://avatars.githubusercontent.com/u/143038?v=3","gravatar_id":"","url":"https://api.github.com/users/aschmid","html_url":"https://github.com/aschmid","followers_url":"https://api.github.com/users/aschmid/followers","following_url":"https://api.github.com/users/aschmid/following{/other_user}","gists_url":"https://api.github.com/users/aschmid/gists{/gist_id}","starred_url":"https://api.github.com/users/aschmid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschmid/subscriptions","organizations_url":"https://api.github.com/users/aschmid/orgs","repos_url":"https://api.github.com/users/aschmid/repos","events_url":"https://api.github.com/users/aschmid/events{/privacy}","received_events_url":"https://api.github.com/users/aschmid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hapijs/hapi/labels/question","name":"question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":{"login":"Marsup","id":796194,"avatar_url":"https://avatars.githubusercontent.com/u/796194?v=3","gravatar_id":"","url":"https://api.github.com/users/Marsup","html_url":"https://github.com/Marsup","followers_url":"https://api.github.com/users/Marsup/followers","following_url":"https://api.github.com/users/Marsup/following{/other_user}","gists_url":"https://api.github.com/users/Marsup/gists{/gist_id}","starred_url":"https://api.github.com/users/Marsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marsup/subscriptions","organizations_url":"https://api.github.com/users/Marsup/orgs","repos_url":"https://api.github.com/users/Marsup/repos","events_url":"https://api.github.com/users/Marsup/events{/privacy}","received_events_url":"https://api.github.com/users/Marsup/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-06-12T14:58:14Z","updated_at":"2015-06-12T15:40:13Z","closed_at":"2015-06-12T15:28:37Z","body":"hi guys,\r\n\r\ni have a weird situation i would like to know how to solve.\r\nin my app errors that happen after functions with promises do net get thrown and the app just stalls.\r\n\r\nhere an example:\r\n\r\n```\r\ngetTenant = (req) ->\r\n  deferred = Q.defer()\r\n\r\n  deferred.resolve('foo') if req.info.referrer\r\n  deferred.resolve('bar') if !req.info.referrer\r\n\r\n  deferred.promise\r\n\r\nRoutes =[\r\n  {\r\n    method: 'GET'\r\n    path:   '/'\r\n    handler: (request, reply) ->\r\n      getTenant(request).then (tenant) ->\r\n        console.log 'tenant', tenant\r\n\r\n        # here `User` is not defined and doesn't even exist\r\n        # why is there no error here?\r\n\r\n        if !User.isAuthorized(request, tenant)\r\n          reply 'not authorized'\r\n        else\r\n          reply 'authorized' \r\n    \r\n  }\r\n]\r\n``` \r\n\r\nafter ```getTenant``` i call a function on ```User```. User doesnt exist or is imported but the app gives me no error. \r\nwhy is that? \r\n\r\nhere the full sample app: https://github.com/aschmid/hapierrortest\r\n\r\nthank you,\r\nandreas"},"comment":{"url":"https://api.github.com/repos/hapijs/hapi/issues/comments/111531097","html_url":"https://github.com/hapijs/hapi/issues/2597#issuecomment-111531097","issue_url":"https://api.github.com/repos/hapijs/hapi/issues/2597","id":111531097,"user":{"login":"Marsup","id":796194,"avatar_url":"https://avatars.githubusercontent.com/u/796194?v=3","gravatar_id":"","url":"https://api.github.com/users/Marsup","html_url":"https://github.com/Marsup","followers_url":"https://api.github.com/users/Marsup/followers","following_url":"https://api.github.com/users/Marsup/following{/other_user}","gists_url":"https://api.github.com/users/Marsup/gists{/gist_id}","starred_url":"https://api.github.com/users/Marsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marsup/subscriptions","organizations_url":"https://api.github.com/users/Marsup/orgs","repos_url":"https://api.github.com/users/Marsup/repos","events_url":"https://api.github.com/users/Marsup/events{/privacy}","received_events_url":"https://api.github.com/users/Marsup/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T15:40:13Z","updated_at":"2015-06-12T15:40:13Z","body":"https://promisesaplus.com/ <- everywhere the word exception appears."}}