{"action":"created","issue":{"url":"https://api.github.com/repos/Thomvis/BrightFutures/issues/107","labels_url":"https://api.github.com/repos/Thomvis/BrightFutures/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/Thomvis/BrightFutures/issues/107/comments","events_url":"https://api.github.com/repos/Thomvis/BrightFutures/issues/107/events","html_url":"https://github.com/Thomvis/BrightFutures/issues/107","id":122591373,"number":107,"title":"generic error handling","user":{"login":"dileping","id":1463444,"avatar_url":"https://avatars.githubusercontent.com/u/1463444?v=3","gravatar_id":"","url":"https://api.github.com/users/dileping","html_url":"https://github.com/dileping","followers_url":"https://api.github.com/users/dileping/followers","following_url":"https://api.github.com/users/dileping/following{/other_user}","gists_url":"https://api.github.com/users/dileping/gists{/gist_id}","starred_url":"https://api.github.com/users/dileping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dileping/subscriptions","organizations_url":"https://api.github.com/users/dileping/orgs","repos_url":"https://api.github.com/users/dileping/repos","events_url":"https://api.github.com/users/dileping/events{/privacy}","received_events_url":"https://api.github.com/users/dileping/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-12-16T20:10:38Z","updated_at":"2015-12-23T21:09:58Z","closed_at":null,"body":"Hi guys,\r\n\r\nfirst of all I really like BrightFutures, they are awesome!\r\n\r\nI have a question about error handling, though. I'm not sure how to handle the errors if I have no idea what error is going to happen while the code is running.\r\n\r\nCould you point me to a solution?\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/Thomvis/BrightFutures/issues/comments/166990371","html_url":"https://github.com/Thomvis/BrightFutures/issues/107#issuecomment-166990371","issue_url":"https://api.github.com/repos/Thomvis/BrightFutures/issues/107","id":166990371,"user":{"login":"dileping","id":1463444,"avatar_url":"https://avatars.githubusercontent.com/u/1463444?v=3","gravatar_id":"","url":"https://api.github.com/users/dileping","html_url":"https://github.com/dileping","followers_url":"https://api.github.com/users/dileping/followers","following_url":"https://api.github.com/users/dileping/following{/other_user}","gists_url":"https://api.github.com/users/dileping/gists{/gist_id}","starred_url":"https://api.github.com/users/dileping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dileping/subscriptions","organizations_url":"https://api.github.com/users/dileping/orgs","repos_url":"https://api.github.com/users/dileping/repos","events_url":"https://api.github.com/users/dileping/events{/privacy}","received_events_url":"https://api.github.com/users/dileping/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T21:09:58Z","updated_at":"2015-12-23T21:09:58Z","body":"@Thomvis I had a look at Result and it's capabilities and it's good for certain goals, but here are several reasons why I have implemented it in another way:\r\n\r\n* Result materialize uses NSError as an exact type. I want to have a capability to use a raw ErrorType\r\n\r\n* it adds certain level of complexity and you will have to use it like\r\n\r\n```swift\r\nfuture {\r\n  return materialize {\r\n    //throwing code here\r\n  }\r\n}\r\n```\r\n\r\n* The code I have provided just enables you to use throwing techniques from inside the futures out of the box (even in map functions and so on)\r\n\r\nI hope all this makes sense. If it makes sense for me (I'm already using it intensively) I hope it would be helpful for others as well.\r\n\r\nLooking forward to have some feedback of yours.\r\n\r\nThanks,\r\nDaniel"}}