ReactiveCommand Exception Handling

138 views
Skip to first unread message

Brian Jenkins

unread,
Jan 25, 2015, 3:20:01 PM1/25/15
to reacti...@googlegroups.com
ThrownExceptions is not catching any exceptions that thrown in my reactive command. I'm not sure what I'm doing wrong here. I never get to the handle error section. My end goal is catch exception, throw a usererror, and display a message to the user from the view. But I never end up catching the exception. Nothing happens after throwing exceptions, except in the output window of VS there is a message that an exception was thrown.

var command = ReactiveCommand.Create();

command.Subscribe(delegate

{

throw new Exception("new exception thrown");

});

command.ThrownExceptions.Subscribe(ex => //handle error)));

paul....@gmail.com

unread,
Jan 27, 2015, 12:01:08 AM1/27/15
to reacti...@googlegroups.com
Hey Brian,

ThrownExceptions doesn’t catch exceptions thrown in Subscribe blocks (nothing does, that’s Undefined Behavior). ThrownExceptions catches exceptions from the block provided to CreateAsyncTask, or OnErrors from the values returned by your CreateAsyncObservable.

Paul


Sent from Mailbox


--
You received this message because you are subscribed to the Google Groups "ReactiveUI mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reactivexaml...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages