PkmnLibSharp/PkmnLibSharp/Utilities/NativeException.cs

32 lines
702 B
C#

using System;
namespace PkmnLibSharp.Utilities
{
public class NativeException : Exception
{
public string? Stack { get; }
public NativeException(string library, string message, string? stack) : base($"[{library}] - '{message}'")
{
Stack = stack;
}
public override string Message
{
get
{
var s = base.Message;
if (Stack != null)
{
s += Environment.NewLine + Stack;
}
return s;
}
}
public override string ToString()
{
return Message;
}
}
}