-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to re-throw exceptions? #16
Comments
You can make this code slightly simpler by using a BFExecutor:
But I'm not sure exactly what problem you are trying to solve. Do you want to kill the app by forcing an unhandled exception? |
I think it'd be good for unhandled exceptions to kill the app or at least produce an error message in the logs. Right now Bolts makes it harder to debug unanticipated exceptions since they're suppressed at the moment (at least when I tested @throwing an exception from an executor with a custom dispatch queue). Throwing an idea out here: what if |
It's quite annoying Bolts handles exceptions right now. Cocoa's philosophy is to use exceptions for fatal programmer errors. IE you've not checked the data type you're using etc… and errors for recoverable things such as the invalid permissions etc… Bolts should have a way to completely disable exception handling or at least allow a way to log them off as it's impossible to raise them right now without passing them outside the task chain and then raising them. |
You are right that it would be good to provide some mechanism to kill the app if an exception doesn't get handled by a continuation. Checking whether |
Sorry may I ask what is the rational behind closing an issue just because "it is not obvious to you what the solution would be"? |
We are trying to re-throw exceptions as follows. But this way is not only ugly but also takes care of only the last
continueWithBlock:
.What would you guys suggest on this?
The text was updated successfully, but these errors were encountered: