use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum LaunchError {
#[error("filesystem error at {path}: {source}")]
Filesystem {
path: PathBuf,
source: std::io::Error,
},
#[error("parse error in {path}: {message}")]
Parse { path: PathBuf, message: String },
#[error("configuration error: {message}")]
Config { message: String },
}
impl LaunchError {
pub fn parse(path: impl Into<PathBuf>, msg: impl Into<String>) -> Self {
Self::Parse {
path: path.into(),
message: msg.into(),
}
}
pub fn config(msg: impl Into<String>) -> Self {
Self::Config {
message: msg.into(),
}
}
}