|
@@ -21,6 +21,7 @@ using Ryujinx.Graphics.Vulkan.MoltenVK;
|
|
|
using Ryujinx.Headless;
|
|
using Ryujinx.Headless;
|
|
|
using Ryujinx.SDL2.Common;
|
|
using Ryujinx.SDL2.Common;
|
|
|
using System;
|
|
using System;
|
|
|
|
|
+using System.Collections.Generic;
|
|
|
using System.IO;
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.InteropServices;
|
|
@@ -243,16 +244,33 @@ namespace Ryujinx.Ava
|
|
|
: $"Launch Mode: {AppDataManager.Mode}");
|
|
: $"Launch Mode: {AppDataManager.Mode}");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- internal static void ProcessUnhandledException(object sender, Exception ex, bool isTerminating)
|
|
|
|
|
|
|
+ internal static void ProcessUnhandledException(object sender, Exception initialException, bool isTerminating)
|
|
|
{
|
|
{
|
|
|
Logger.Log log = Logger.Error ?? Logger.Notice;
|
|
Logger.Log log = Logger.Error ?? Logger.Notice;
|
|
|
- string message = $"Unhandled exception caught: {ex}";
|
|
|
|
|
|
|
|
|
|
- // ReSharper disable once ConstantConditionalAccessQualifier
|
|
|
|
|
- if (sender?.GetType()?.AsPrettyString() is { } senderName)
|
|
|
|
|
- log.Print(LogClass.Application, message, senderName);
|
|
|
|
|
|
|
+ List<Exception> exceptions = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (initialException is AggregateException ae)
|
|
|
|
|
+ {
|
|
|
|
|
+ exceptions.AddRange(ae.InnerExceptions);
|
|
|
|
|
+ }
|
|
|
else
|
|
else
|
|
|
- log.PrintMsg(LogClass.Application, message);
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ exceptions.Add(initialException);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ foreach (var e in exceptions)
|
|
|
|
|
+ {
|
|
|
|
|
+ string message = $"Unhandled exception caught: {e}";
|
|
|
|
|
+ // ReSharper disable once ConstantConditionalAccessQualifier
|
|
|
|
|
+ if (sender?.GetType()?.AsPrettyString() is { } senderName)
|
|
|
|
|
+ log.Print(LogClass.Application, message, senderName);
|
|
|
|
|
+ else
|
|
|
|
|
+ log.PrintMsg(LogClass.Application, message);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if (isTerminating)
|
|
if (isTerminating)
|
|
|
Exit();
|
|
Exit();
|