From e1dadddf0698ff5be8e2f4c18de81f04d4c483f7 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 30 Apr 2021 13:53:41 +0200 Subject: [PATCH] Fixes exception not showing c++ stacktrace in some cases. --- PkmnLibSharp/Utilities/NativeException.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/PkmnLibSharp/Utilities/NativeException.cs b/PkmnLibSharp/Utilities/NativeException.cs index ec6bdf4..1357594 100644 --- a/PkmnLibSharp/Utilities/NativeException.cs +++ b/PkmnLibSharp/Utilities/NativeException.cs @@ -11,14 +11,22 @@ namespace PkmnLibSharp.Utilities Stack = stack; } + public override string Message + { + get + { + var s = base.Message; + if (Stack != null) + { + s += Environment.NewLine + Stack; + } + return s; + } + } + public override string ToString() { - var s = base.ToString(); - if (Stack != null) - { - s += Environment.NewLine + Stack; - } - return s; + return Message; } } } \ No newline at end of file