From d05a259efc673e7d6f149ee2897ef7224e2f0620 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Thu, 19 Aug 2021 23:31:12 +0200 Subject: [PATCH] fix: only show TargetSite in exception info --- Dalamud/EntryPoint.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dalamud/EntryPoint.cs b/Dalamud/EntryPoint.cs index 3a57d2b14..f365d7912 100644 --- a/Dalamud/EntryPoint.cs +++ b/Dalamud/EntryPoint.cs @@ -195,12 +195,19 @@ namespace Dalamud case Exception ex: Log.Fatal(ex, "Unhandled exception on AppDomain"); - var info = ex.StackTrace?.Split('\n').Take(4).Append("[...]").Join(delimiter: "\n"); + var info = "Further information could not be obtained"; + if (ex.TargetSite != null && ex.TargetSite.DeclaringType != null) + { + info = + $"{ex.TargetSite.DeclaringType.Assembly.GetName().Name}, {ex.TargetSite.DeclaringType.FullName}::{ex.TargetSite.Name}"; + } Util.Fatal( - $"An internal error in a Dalamud plugin occurred.\nThe game must close.\n\n{ex.GetType().Name} - {ex.Message}\n{info}\n\nMore information has been recorded separately, please contact us in our Discord or on GitHub.\n\nDo you want to disable all plugins the next time you start the game?", + $"An internal error in a Dalamud plugin occurred.\nThe game must close.\n\nType: {ex.GetType().Name}\n{info}\n\nMore information has been recorded separately, please contact us in our Discord or on GitHub.\n\nDo you want to disable all plugins the next time you start the game?", "Dalamud"); + // TODO Plugin disabling + break; default: Log.Fatal("Unhandled SEH object on AppDomain: {Object}", args.ExceptionObject);