summaryrefslogtreecommitdiff
path: root/src/error.rs
blob: 360e62d1a842ee884f7a5bd8511142be45b8fee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::path::PathBuf;
use thiserror::Error;

/// Define all the kinds of errors any part of this crate can return.
#[derive(Debug, Error)]
pub enum ObnamError {
    #[error("Can't find backup '{0}'")]
    UnknownGeneration(String),

    #[error("Generation has more than one file with the name {0}")]
    TooManyFiles(PathBuf),

    #[error("Server response did not have a 'chunk-meta' header for chunk {0}")]
    NoChunkMeta(String),

    #[error("Wrong checksum for chunk {0}")]
    WrongChecksum(String),
}