Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

namespace System.Runtime.ExceptionServices
{
public delegate bool UnhandledExceptionHandler(System.Exception exception);

public static class ExceptionHandling
{
internal static UnhandledExceptionHandler? s_handler;
internal static Func<Exception, bool>? s_handler;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@

namespace System.Runtime.ExceptionServices
{
public delegate bool UnhandledExceptionHandler(System.Exception exception);

public static class ExceptionHandling
{
internal static UnhandledExceptionHandler? s_handler;
internal static Func<Exception, bool>? s_handler;

/// <summary>
/// Sets a handler for unhandled exceptions.
/// </summary>
/// <exception cref="ArgumentNullException">If handler is null</exception>
/// <exception cref="InvalidOperationException">If a handler is already set</exception>
public static void SetUnhandledExceptionHandler(UnhandledExceptionHandler handler)
public static void SetUnhandledExceptionHandler(Func<Exception, bool> handler)
{
ArgumentNullException.ThrowIfNull(handler);

Expand Down
3 changes: 1 addition & 2 deletions src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13975,7 +13975,7 @@ internal ExceptionDispatchInfo() { }
}
public static partial class ExceptionHandling
{
public static void SetUnhandledExceptionHandler(System.Runtime.ExceptionServices.UnhandledExceptionHandler handler) { }
public static void SetUnhandledExceptionHandler(System.Func<System.Exception,bool> handler) { }
}
public partial class FirstChanceExceptionEventArgs : System.EventArgs
{
Expand All @@ -13988,7 +13988,6 @@ public sealed partial class HandleProcessCorruptedStateExceptionsAttribute : Sys
{
public HandleProcessCorruptedStateExceptionsAttribute() { }
}
public delegate bool UnhandledExceptionHandler(System.Exception exception);
}
namespace System.Runtime.InteropServices
{
Expand Down