use thiserror::Error;
#[derive(Debug, Error, PartialEq, Eq)]
pub enum TranslateError {
#[error("check request is missing the attributes field")]
MissingAttributes,
#[error("check request attributes are missing the request field")]
MissingRequest,
#[error("check request is missing the HTTP request field")]
MissingHttpRequest,
#[error("check request HTTP method is empty or invalid: {0:?}")]
InvalidHttpMethod(String),
}
#[derive(Debug, Error)]
pub enum KernelError {
#[error("kernel evaluation failed: {0}")]
Evaluation(String),
}
impl KernelError {
pub fn evaluation(reason: impl std::fmt::Display) -> Self {
Self::Evaluation(reason.to_string())
}
}