namespace Brutal.JoltApi;
///
/// The exception thrown when a Jolt operation fails - a shape, constraint or settings object that won't build, or
/// an object stream that won't restore. Its carries the error text Jolt reported
/// () at the point of failure.
///
///
/// A bad argument the binding catches before calling into Jolt still throws the usual
/// or ; this one means Jolt itself refused.
///
public class JoltException : Exception
{
/// Initializes a new with the given message.
/// The failure description, typically Jolt's own error text.
public JoltException(string message)
: base(message) { }
/// Initializes a new with the given message and inner exception.
/// The failure description, typically Jolt's own error text.
/// The underlying exception that caused this failure.
public JoltException(string message, Exception innerException)
: base(message, innerException) { }
///
/// Creates a whose message is the calling thread's last Jolt error
/// ().
///
public static JoltException FromLastError() => new(Jolt.GetLastError());
}