#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::string::{String, ToString};
pub type Result<T = (), E = Error> = core::result::Result<T, E>;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("invalid configuration: {0}")]
Config(String),
#[error("invalid run id: {0}")]
InvalidRunId(String),
#[error("unrecognized branch or slug: {0}")]
UnrecognizedPattern(String),
#[error("serialization failure: {0}")]
Serialization(String),
#[error("{0}")]
Unknown(String),
}
impl Error {
pub fn config(message: impl core::fmt::Display) -> Self {
Self::Config(message.to_string())
}
pub fn unknown(message: impl core::fmt::Display) -> Self {
Self::Unknown(message.to_string())
}
}