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

Command.Subscribe treat Exception #756

Closed
melopigmaster opened this issue Nov 12, 2014 · 2 comments
Closed

Command.Subscribe treat Exception #756

melopigmaster opened this issue Nov 12, 2014 · 2 comments
Labels

Comments

@melopigmaster
Copy link

  _command = ReactiveCommand.Create(Observable.Return(true));
                     _command .Subscribe(x => { throw new Exception("error"); });

public partial class App : Application
     {
         protected override void OnStartup(StartupEventArgs e)
         {
             Current.DispatcherUnhandledException += CurrentOnDispatcherUnhandledException;
         }
}

   private void CurrentOnDispatcherUnhandledException(
             object sender,
             DispatcherUnhandledExceptionEventArgs dispatcherUnhandledExceptionEventArgs)
         {
         }

    UserError.RegisterHandler(exc =>
             {
                 return Observable.Return(RecoveryOptionResult.CancelOperation);
             });

In version 5 exception is caught here

  RxApp.DefaultExceptionHandler = Observer.Create<Exception>(exc =>
             {

             });

Now they do not come back

@anaisbetts
Copy link
Member

The fact that they were caught in v5 was solely by coincidence, exceptions thrown in Subscribes aren't handled by Rx. ThrownExceptions catches the OnError from the Observable created via CreateAsyncObservable, or the exception thrown by the block in CreateAsyncTask

@melopigmaster
Copy link
Author

I think that should come in CurrentOnDispatcherUnhandledException but do not come

@lock lock bot added the outdated label Jun 26, 2019
@lock lock bot locked and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants