From 538bd72167b2d4e256b5b14a73cb8fbdad1eefca Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Fri, 22 Dec 2023 15:12:01 -0800 Subject: [PATCH] updated Exceptions interface to let us return an ExecutionFlow from report, and to let us dispatch in the current thread --- NBug/Exceptions.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/NBug/Exceptions.cs b/NBug/Exceptions.cs index dad70a9..3c92753 100644 --- a/NBug/Exceptions.cs +++ b/NBug/Exceptions.cs @@ -88,14 +88,21 @@ public static void Handle(Action body) { /// Note that this function uses the NBug configuration so it will use the pre-configured UI and submission settings. /// /// The exception to submit as the bug report. - public static void Report(Exception exception) + public static ExecutionFlow Report(Exception exception) { // Below never exits application by itself (by design) so execution of the application continues normally - new BugReport().Report(exception, ExceptionThread.Main); + return new BugReport().Report(exception, ExceptionThread.Main); } - public static void Dispatch() { - new Dispatcher(); - } + public static void Dispatch() { + new Dispatcher(); + } + + /// + /// Override the DispatcherIsAsynchronous setting to dispatch immediately in-thread + /// + public static void DispatchInCurrentThread() { + new Dispatcher(false); + } } }