sed_rs/error.rs
1use std::path::PathBuf;
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5 #[error("invalid regex: {0}")]
6 Regex(#[from] regex::Error),
7
8 #[error("{0}")]
9 Io(#[from] std::io::Error),
10
11 #[error("failed to persist file: {0}")]
12 TempfilePersist(#[from] tempfile::PersistError),
13
14 #[error("invalid path: {0}")]
15 InvalidPath(PathBuf),
16
17 #[error("parse error: {0}")]
18 Parse(String),
19}
20
21pub type Result<T, E = Error> = std::result::Result<T, E>;