2020-05-02 20:58:08 +00:00
|
|
|
using System;
|
|
|
|
|
2020-05-04 15:54:34 +00:00
|
|
|
namespace PkmnLibSharp.Utilities
|
2020-05-02 20:58:08 +00:00
|
|
|
{
|
|
|
|
public class NativeException : Exception
|
|
|
|
{
|
2020-08-17 16:51:07 +00:00
|
|
|
public string? Stack { get; }
|
|
|
|
|
|
|
|
public NativeException(string library, string message, string? stack) : base($"[{library}] - '{message}'")
|
2020-05-02 20:58:08 +00:00
|
|
|
{
|
2020-08-17 16:51:07 +00:00
|
|
|
Stack = stack;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
var s = base.ToString();
|
|
|
|
if (Stack != null)
|
|
|
|
{
|
|
|
|
s += Environment.NewLine + Stack;
|
|
|
|
}
|
|
|
|
return s;
|
2020-05-02 20:58:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|