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 ToString()
        {
            var s = base.ToString();
            if (Stack != null)
            {
                s += Environment.NewLine + Stack;
            }
            return s;
        }
    }
}