Skip to main content

kea_lifecycle/
error.rs

1use crate::{buildpack::error::BuildpackError, cmd::detector::error::DetectorError};
2
3pub type Result<T> = std::result::Result<T, LifecycleError>;
4
5#[derive(thiserror::Error, Debug)]
6pub enum LifecycleError {
7    #[error("Detector error. ({0:?})")]
8    BuildpackError(BuildpackError),
9
10    #[error("Detector error. ({0:?})")]
11    DetectorError(DetectorError),
12}
13
14impl From<BuildpackError> for LifecycleError {
15    fn from(value: BuildpackError) -> Self {
16        Self::BuildpackError(value)
17    }
18}
19
20impl From<DetectorError> for LifecycleError {
21    fn from(value: DetectorError) -> Self {
22        Self::DetectorError(value)
23    }
24}