Skip to content
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

Handle exceptions from RACSignal+Operations blocks #21

Closed
jspahrsummers opened this issue Aug 1, 2012 · 6 comments
Closed

Handle exceptions from RACSignal+Operations blocks #21

jspahrsummers opened this issue Aug 1, 2012 · 6 comments

Comments

@jspahrsummers
Copy link
Member

For blocks given to RACSignal+Operations methods that don't themselves return a signal, it's difficult – if not outright impossible – to indicate error cases. RAC could catch exceptions thrown by those blocks (since it invokes them directly) and translate those into errors.

@joshaber
Copy link
Member

joshaber commented Nov 4, 2012

If/when we do this, we should also support throwing exceptions within the lift methods.

@jspahrsummers
Copy link
Member Author

There are some complexities around this that might make it untenable for 1.0. Exceptions and errors aren't trivially convertible in Cocoa (we'd probably need some special kind of error that includes the exception in its userInfo), and scheduling would probably have to be updated to be exception-safe.

I'd still like to do this at some point, but, given that exceptions are usually considered fatal in Cocoa, I don't think this is important enough to block a stable release on.

@joshaber
Copy link
Member

joshaber commented Dec 8, 2012

👍

@jspahrsummers
Copy link
Member Author

Meh.

@fatuhoku
Copy link

Hmm. I'm building a synchronization algorithm and as such BDD is pretty valuable. The process depends on accurate error feedback so that I can adjust the code in meaningful ways to make progress.

I opened #1546 because I ran into a situation where exceptions were being thrown and I had no way of finding out what was wrong.

@jspahrsummers
Copy link
Member Author

As noted in #1546 (comment), exceptions are intended to be fatal in Objective-C. Catching them would cause all sorts of undefined behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants