Skip to content

Commit

Permalink
updated Exceptions interface to let us return an ExecutionFlow from r…
Browse files Browse the repository at this point in the history
…eport, and to let us dispatch in the current thread
  • Loading branch information
theJenix committed Dec 22, 2023
1 parent edc4b25 commit 538bd72
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions NBug/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </summary>
/// <param name="exception">The exception to submit as the bug report.</param>
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();
}

/// <summary>
/// Override the DispatcherIsAsynchronous setting to dispatch immediately in-thread
/// </summary>
public static void DispatchInCurrentThread() {
new Dispatcher(false);
}
}
}

0 comments on commit 538bd72

Please sign in to comment.