Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -302,7 +302,7 @@ public event System.EventHandler? ProcessExit { add { } remove { } }
public event System.ResolveEventHandler? ReflectionOnlyAssemblyResolve { add { } remove { } }
public event System.ResolveEventHandler? ResourceResolve { add { } remove { } }
public event System.ResolveEventHandler? TypeResolve { add { } remove { } }
public event System.UnhandledExceptionEventHandler? UnhandledException { add { } remove { } }
public event Func<Exception, bool>? UnhandledException { add { } remove { } }
Comment thread
teo-tsirpanis marked this conversation as resolved.
Outdated
[System.ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated and is not supported.")]
public void AppendPrivatePath(string? path) { }
public string ApplyPolicy(string assemblyName) { throw null; }
Expand Down Expand Up @@ -7551,7 +7551,6 @@ public UnhandledExceptionEventArgs(object exception, bool isTerminating) { }
public object ExceptionObject { get { throw null; } }
public bool IsTerminating { get { throw null; } }
}
public delegate void UnhandledExceptionEventHandler(object sender, System.UnhandledExceptionEventArgs e);
public partial struct ValueTuple : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple>, System.IEquatable<System.ValueTuple>, System.Runtime.CompilerServices.ITuple
{
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
Expand Down