streamd/src/error.rs
Konstantin Fickel 8d07a86fc4
All checks were successful
Continuous Integration / Lint, Check & Test (push) Successful in 1m47s
Continuous Integration / Build Package (push) Successful in 2m20s
chore: switch from yaml to toml
2026-03-29 19:14:51 +02:00

25 lines
579 B
Rust

use thiserror::Error;
#[derive(Error, Debug)]
pub enum StreamdError {
#[error("Could not extract date from file name: {0}")]
DateExtractionError(String),
#[error("Timesheet error: {0}")]
TimesheetError(String),
#[error("Configuration error: {0}")]
ConfigError(String),
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("TOML error: {0}")]
TomlError(#[from] toml::de::Error),
}
impl From<StreamdError> for miette::Report {
fn from(err: StreamdError) -> Self {
miette::Report::msg(err.to_string())
}
}