//! Possible errors returned by the CI broker library. use std::path::PathBuf; use crate::{config::ConfigError, msg::MessageError}; /// All possible errors from the CI broker messages. #[derive(Debug, thiserror::Error)] pub enum BrokerError { /// A configuration related error. #[error(transparent)] Config(#[from] ConfigError), /// A message related error. #[error(transparent)] Message(#[from] MessageError), /// Error from an node event subscriber. #[error(transparent)] NodeEvent(#[from] crate::event::NodeEventError), /// Error from Radicle. #[error(transparent)] RadicleProfile(#[from] radicle::profile::Error), /// Error from spawning a sub-process. #[error("failed to spawn a CI adapter sub-process: {0}")] SpawnAdapter(PathBuf, #[source] std::io::Error), /// Usage error. #[error("usage: radicle-ci-broker CONFIG")] Usage, /// Default adapter is not in list of adapters. #[error("default adapter is not in list of adapters")] UnknownDefaultAdapter(String), }