{"action":"created","issue":{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/106","labels_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/106/comments","events_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/106/events","html_url":"https://github.com/BoltsFramework/Bolts-Android/pull/106","id":123437639,"number":106,"title":"continuation with bad Executor leads to un-predictable result and the Exception is hidden","user":{"login":"yunarta","id":8254829,"avatar_url":"https://avatars.githubusercontent.com/u/8254829?v=3","gravatar_id":"","url":"https://api.github.com/users/yunarta","html_url":"https://github.com/yunarta","followers_url":"https://api.github.com/users/yunarta/followers","following_url":"https://api.github.com/users/yunarta/following{/other_user}","gists_url":"https://api.github.com/users/yunarta/gists{/gist_id}","starred_url":"https://api.github.com/users/yunarta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunarta/subscriptions","organizations_url":"https://api.github.com/users/yunarta/orgs","repos_url":"https://api.github.com/users/yunarta/repos","events_url":"https://api.github.com/users/yunarta/events{/privacy}","received_events_url":"https://api.github.com/users/yunarta/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/labels/CLA%20Signed","name":"CLA Signed","color":"009900"},{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/labels/GH%20Review:%20accepted","name":"GH Review: accepted","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-12-22T08:25:56Z","updated_at":"2016-01-07T16:50:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/pulls/106","html_url":"https://github.com/BoltsFramework/Bolts-Android/pull/106","diff_url":"https://github.com/BoltsFramework/Bolts-Android/pull/106.diff","patch_url":"https://github.com/BoltsFramework/Bolts-Android/pull/106.patch"},"body":"I'm using bolts heavily with Executor to synchronizes the continuation blocks. \r\nWhen i made a mistake in the Executor implementation, causes a NullPointerException to be raised, i found that this would crash the app due to the exception was raised to the previous Task.\r\n\r\nThe snippets kind of like below\r\n```\r\nTask.callInBackground(T1).onSuccess(new Continuation() {\r\n    public Object then(Task task) { }\r\n}, BadExecutors).continueWith(new Continuation() {\r\n    public Object then(Task task) { \r\n        if (task.isFaulted()) task.getError().printStackTrace()\r\n    }\r\n});\r\n```\r\n\r\nSince the BadExecutors throws NPE, rather then having the NPE being sent to to next continuation block, it crashes the app with IllegalStateException(\"Cannot set the error on a completed task.\")\r\n\r\nThis is caused by the the Executor.execute is not wrapped by try-catch, causing the exception being sent  back to finishing block of the previous task in the chain where the Task result being set as completed, continuations blocks is being executed\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/comments/169725119","html_url":"https://github.com/BoltsFramework/Bolts-Android/pull/106#issuecomment-169725119","issue_url":"https://api.github.com/repos/BoltsFramework/Bolts-Android/issues/106","id":169725119,"user":{"login":"yunarta","id":8254829,"avatar_url":"https://avatars.githubusercontent.com/u/8254829?v=3","gravatar_id":"","url":"https://api.github.com/users/yunarta","html_url":"https://github.com/yunarta","followers_url":"https://api.github.com/users/yunarta/followers","following_url":"https://api.github.com/users/yunarta/following{/other_user}","gists_url":"https://api.github.com/users/yunarta/gists{/gist_id}","starred_url":"https://api.github.com/users/yunarta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunarta/subscriptions","organizations_url":"https://api.github.com/users/yunarta/orgs","repos_url":"https://api.github.com/users/yunarta/repos","events_url":"https://api.github.com/users/yunarta/events{/privacy}","received_events_url":"https://api.github.com/users/yunarta/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T16:50:11Z","updated_at":"2016-01-07T16:50:11Z","body":"I made fixes to Task.call(callable, executor) as well"}}