mirror of
https://seed.radicle.dev/rad:zwTxygwuz5LDGBq255RA2CbNGrz8.git
synced 2026-11-29 06:40:31 +08:00
It's more tidy if every module has its own error type, to avoid unnecessary coupling and tangling between modules. Signed-off-by: Lars Wirzenius <liw@liw.fi>
38 lines
1.0 KiB
Rust
38 lines
1.0 KiB
Rust
//! 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),
|
|
}
|