Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created June 20, 2021 13:33
Show Gist options
  • Save rdelrosario/1238f341b6fa01744be7406d871550cd to your computer and use it in GitHub Desktop.
Save rdelrosario/1238f341b6fa01744be7406d871550cd to your computer and use it in GitHub Desktop.
namespace ReactiveToDoSample
{
public class RxExceptionHandler : IObserver<Exception>
{
public void OnNext(Exception ex)
{
if (Debugger.IsAttached)
{
Debugger.Break();
}
RxApp.MainThreadScheduler.Schedule(() => { throw ex; });
}
public void OnError(Exception ex)
{
if (Debugger.IsAttached)
{
Debugger.Break();
}
RxApp.MainThreadScheduler.Schedule(() => { throw ex; });
}
public void OnCompleted()
{
if (Debugger.IsAttached)
{
Debugger.Break();
}
RxApp.MainThreadScheduler.Schedule(() => { throw new NotImplementedException(); });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment