up_rs/errors.rs
1//! Overall errors thrown by the up crate.
2use camino::Utf8PathBuf;
3use displaydoc::Display;
4use std::io;
5use thiserror::Error;
6
7#[derive(Error, Debug, Display)]
8/// Errors thrown by the Up Crate.
9pub enum UpError {
10 /// Failed to delete `{path}`.
11 DeleteError {
12 /// Path we tried to delete.
13 path: Utf8PathBuf,
14 /// Source error.
15 source: io::Error,
16 },
17 /// IO Failure for path `{path}`.
18 IoError {
19 /// Path we tried to write to.
20 path: Utf8PathBuf,
21 /// Source error.
22 source: io::Error,
23 },
24 /// Couldn't calculate the current user's home directory.
25 NoHomeDir,
26}