You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Merge pull request #46174 from xill47/mono-appdomain-unhandled-exception-event
Added mono_unhandled_exception call to unhandled_exception hook
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Godot
|
||||
{
|
||||
public static partial class GD
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when an unhandled exception occurs, regardless of project settings.
|
||||
/// </summary>
|
||||
public static event EventHandler<UnhandledExceptionArgs> UnhandledException;
|
||||
|
||||
private static void OnUnhandledException(Exception e)
|
||||
{
|
||||
UnhandledException?.Invoke(null, new UnhandledExceptionArgs(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace Godot
|
||||
{
|
||||
/// <summary>
|
||||
/// Event arguments for when unhandled exceptions occur.
|
||||
/// </summary>
|
||||
public class UnhandledExceptionArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception object
|
||||
/// </summary>
|
||||
public Exception Exception { get; private set; }
|
||||
|
||||
internal UnhandledExceptionArgs(Exception exception)
|
||||
{
|
||||
Exception = exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@
|
||||
<Compile Include="Core\GodotSynchronizationContext.cs" />
|
||||
<Compile Include="Core\GodotTaskScheduler.cs" />
|
||||
<Compile Include="Core\GodotTraceListener.cs" />
|
||||
<Compile Include="Core\GodotUnhandledExceptionEvent.cs" />
|
||||
<Compile Include="Core\Interfaces\IAwaitable.cs" />
|
||||
<Compile Include="Core\Interfaces\IAwaiter.cs" />
|
||||
<Compile Include="Core\Interfaces\ISerializationListener.cs" />
|
||||
@@ -59,6 +60,7 @@
|
||||
<Compile Include="Core\StringName.cs" />
|
||||
<Compile Include="Core\Transform.cs" />
|
||||
<Compile Include="Core\Transform2D.cs" />
|
||||
<Compile Include="Core\UnhandledExceptionArgs.cs" />
|
||||
<Compile Include="Core\Vector2.cs" />
|
||||
<Compile Include="Core\Vector2i.cs" />
|
||||
<Compile Include="Core\Vector3.cs" />
|
||||
|
||||
Reference in New Issue
Block a user