add unhandled exception handler
This commit is contained in:
parent
8406ec6272
commit
00f03f99ba
2 changed files with 15 additions and 0 deletions
|
@ -5,6 +5,7 @@ namespace Ryujinx.Common.Logging
|
||||||
Audio,
|
Audio,
|
||||||
Cpu,
|
Cpu,
|
||||||
Font,
|
Font,
|
||||||
|
Emulation,
|
||||||
Gpu,
|
Gpu,
|
||||||
Hid,
|
Hid,
|
||||||
Kernel,
|
Kernel,
|
||||||
|
|
|
@ -24,6 +24,8 @@ namespace Ryujinx
|
||||||
|
|
||||||
Logger.Updated += ConsoleLog.Log;
|
Logger.Updated += ConsoleLog.Log;
|
||||||
|
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
|
||||||
if (args.Length == 1)
|
if (args.Length == 1)
|
||||||
{
|
{
|
||||||
if (Directory.Exists(args[0]))
|
if (Directory.Exists(args[0]))
|
||||||
|
@ -86,6 +88,18 @@ namespace Ryujinx
|
||||||
audioOut.Dispose();
|
audioOut.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
var exception = e.ExceptionObject as Exception;
|
||||||
|
|
||||||
|
Logger.PrintError(LogClass.Emulation, $"Unhandled exception caught: {exception}");
|
||||||
|
Logger.PrintInfo(LogClass.Emulation,"Press any key to close the application...");
|
||||||
|
|
||||||
|
Console.ReadKey();
|
||||||
|
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine
|
/// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue