use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("AOCL '{component}' returned error code {code}: {message}")]
Status {
component: &'static str,
code: i64,
message: String,
},
#[error("invalid argument: {0}")]
InvalidArgument(String),
#[error("AOCL allocation failed in component '{0}'")]
AllocationFailed(&'static str),
#[error("AOCL returned a non-UTF-8 string: {0}")]
InvalidUtf8(#[from] std::str::Utf8Error),
#[error("AOCL returned a string without NUL terminator")]
MissingNul,
}