{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/434","labels_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/434/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/434/comments","events_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/434/events","html_url":"https://github.com/NativeScript/ios-runtime/issues/434","id":121202213,"number":434,"title":"Call global onUncaughtError callback when a NSException occurs","user":{"login":"jasssonpet","id":305639,"avatar_url":"https://avatars.githubusercontent.com/u/305639?v=3","gravatar_id":"","url":"https://api.github.com/users/jasssonpet","html_url":"https://github.com/jasssonpet","followers_url":"https://api.github.com/users/jasssonpet/followers","following_url":"https://api.github.com/users/jasssonpet/following{/other_user}","gists_url":"https://api.github.com/users/jasssonpet/gists{/gist_id}","starred_url":"https://api.github.com/users/jasssonpet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasssonpet/subscriptions","organizations_url":"https://api.github.com/users/jasssonpet/orgs","repos_url":"https://api.github.com/users/jasssonpet/repos","events_url":"https://api.github.com/users/jasssonpet/events{/privacy}","received_events_url":"https://api.github.com/users/jasssonpet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/NativeScript/ios-runtime/milestones/12","html_url":"https://github.com/NativeScript/ios-runtime/milestones/1.6.0%20(Under%20review)","labels_url":"https://api.github.com/repos/NativeScript/ios-runtime/milestones/12/labels","id":1430835,"number":12,"title":"1.6.0 (Under review)","description":"","creator":{"login":"atanasovg","id":5878999,"avatar_url":"https://avatars.githubusercontent.com/u/5878999?v=3","gravatar_id":"","url":"https://api.github.com/users/atanasovg","html_url":"https://github.com/atanasovg","followers_url":"https://api.github.com/users/atanasovg/followers","following_url":"https://api.github.com/users/atanasovg/following{/other_user}","gists_url":"https://api.github.com/users/atanasovg/gists{/gist_id}","starred_url":"https://api.github.com/users/atanasovg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atanasovg/subscriptions","organizations_url":"https://api.github.com/users/atanasovg/orgs","repos_url":"https://api.github.com/users/atanasovg/repos","events_url":"https://api.github.com/users/atanasovg/events{/privacy}","received_events_url":"https://api.github.com/users/atanasovg/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":18,"state":"open","created_at":"2015-11-26T09:57:30Z","updated_at":"2016-01-04T15:18:14Z","due_on":"2016-02-16T22:00:00Z","closed_at":null},"comments":18,"created_at":"2015-12-09T10:10:26Z","updated_at":"2016-01-04T17:27:33Z","closed_at":null,"body":"```javascript\r\nvar arr = NSArray.array();\r\nvar obj = arr[3]; // A NSException is called\r\n\r\nglobal.__onUncaughtError = function (e) {\r\n    // This should be called\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/comments/168743462","html_url":"https://github.com/NativeScript/ios-runtime/issues/434#issuecomment-168743462","issue_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/434","id":168743462,"user":{"login":"jasssonpet","id":305639,"avatar_url":"https://avatars.githubusercontent.com/u/305639?v=3","gravatar_id":"","url":"https://api.github.com/users/jasssonpet","html_url":"https://github.com/jasssonpet","followers_url":"https://api.github.com/users/jasssonpet/followers","following_url":"https://api.github.com/users/jasssonpet/following{/other_user}","gists_url":"https://api.github.com/users/jasssonpet/gists{/gist_id}","starred_url":"https://api.github.com/users/jasssonpet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasssonpet/subscriptions","organizations_url":"https://api.github.com/users/jasssonpet/orgs","repos_url":"https://api.github.com/users/jasssonpet/repos","events_url":"https://api.github.com/users/jasssonpet/events{/privacy}","received_events_url":"https://api.github.com/users/jasssonpet/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T17:27:33Z","updated_at":"2016-01-04T17:27:33Z","body":"btw, I've finally found the StackOverflow answer (from an Apple employee) that we spoke of:\r\n\r\n> Any exception that passes through system framework code will leave said framework in an undefined state.. Catching said exceptions and trying to recover from it will lead to memory leaks, undefined behaviour and crashing.\r\n\r\n> Just because the language has syntax to support something, doesn't mean the frameworks are designed to support that thing, too. The frameworks have a very firm policy: exceptions are unrecoverable errors. Trying to catch and recover goes against framework design and, quite clearly, an exception that \"jumps over\" framework based stack frames is a violation of documented policy and will yield unspecified behavior.\r\n\r\nhttp://stackoverflow.com/a/3379240/477981"}}