#[allow(dead_code)]
pub(crate) type Result<T = ()> = core::result::Result<T, EngineError>;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum EngineError {
#[cfg(feature = "alloc")]
#[error("Invalid operation: {0}")]
InvalidOperation(String),
#[error(transparent)]
CoreError(#[from] acme_core::error::Error),
}
#[cfg(feature = "alloc")]
impl From<EngineError> for acme_core::error::Error {
fn from(err: EngineError) -> Self {
match err {
EngineError::CoreError(e) => e,
_ => acme_core::error::Error::box_error(err),
}
}
}
#[cfg(feature = "alloc")]
impl From<String> for EngineError {
fn from(value: String) -> Self {
acme_core::Error::unknown(value).into()
}
}
#[cfg(feature = "alloc")]
impl From<&str> for EngineError {
fn from(value: &str) -> Self {
acme_core::Error::unknown(value).into()
}
}