using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Keystone
{
public sealed class KeystoneException : Exception
{
public KeystoneError Error { get; }
internal KeystoneException(string message, KeystoneError error) : base(message + '.')
{
Debug.Assert(error != KeystoneError.KS_ERR_OK);
Error = error;
}
public override string ToString()
{
return $"{Message}: {Engine.ErrorToString(Error)}.";
}
}
}