refactor: server: use thiserror

This commit is contained in:
Paul Campbell 2024-06-03 20:34:01 +01:00
parent 621e599b31
commit e29c274aaf
2 changed files with 4 additions and 3 deletions

View file

@ -41,6 +41,7 @@ warp = { workspace = true }
# boilerplate
derive_more = { workspace = true }
thiserror = { workspace = true }
# file watcher
inotify = { workspace = true }

View file

@ -15,11 +15,11 @@ pub struct WatchFile;
#[rtype(result = "()")]
pub struct FileUpdated;
#[derive(Debug, derive_more::From, derive_more::Display)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
Io(std::io::Error),
#[error("io")]
Io(#[from] std::io::Error),
}
impl std::error::Error for Error {}
pub struct FileWatcher {
path: PathBuf,