mirror of https://github.com/zkat/cacache-rs.git
doc(error): document all errors
This commit is contained in:
parent
da112036c1
commit
d2d7170a9c
|
|
@ -9,20 +9,31 @@ use walkdir;
|
||||||
/// Error type returned by all API calls.
|
/// Error type returned by all API calls.
|
||||||
#[derive(Fail, Debug)]
|
#[derive(Fail, Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
/// Returned when an index or content entry could not be found during
|
||||||
|
/// lookup.
|
||||||
#[fail(display = "not found")]
|
#[fail(display = "not found")]
|
||||||
NotFound,
|
NotFound,
|
||||||
|
/// Returned when an integrity check has failed.
|
||||||
#[fail(display = "integrity check failed")]
|
#[fail(display = "integrity check failed")]
|
||||||
IntegrityError,
|
IntegrityError,
|
||||||
|
/// Returned when a size check has failed.
|
||||||
#[fail(display = "size check failed")]
|
#[fail(display = "size check failed")]
|
||||||
SizeError,
|
SizeError,
|
||||||
|
/// Returned when there's an std::io::Error.
|
||||||
#[fail(display = "{}", _0)]
|
#[fail(display = "{}", _0)]
|
||||||
Io(#[fail(cause)] io::Error),
|
Io(#[fail(cause)] io::Error),
|
||||||
|
/// Returned when there's an error with changing uid/gid on an entry.
|
||||||
#[fail(display = "{}", _0)]
|
#[fail(display = "{}", _0)]
|
||||||
Chownr(#[fail(cause)] chownr::Error),
|
Chownr(#[fail(cause)] chownr::Error),
|
||||||
|
/// Returned when there's an issue with metadata (de)serialization.
|
||||||
#[fail(display = "{}", _0)]
|
#[fail(display = "{}", _0)]
|
||||||
SerdeJson(#[fail(cause)] serde_json::error::Error),
|
SerdeJson(#[fail(cause)] serde_json::error::Error),
|
||||||
|
/// Returned when a content entry could not be moved to its final
|
||||||
|
/// destination.
|
||||||
#[fail(display = "{}", _0)]
|
#[fail(display = "{}", _0)]
|
||||||
PersistError(#[fail(cause)] tempfile::PersistError),
|
PersistError(#[fail(cause)] tempfile::PersistError),
|
||||||
|
/// Returned when something went wrong while traversing the index during
|
||||||
|
/// `cacache::ls`.
|
||||||
#[fail(display = "{}", _0)]
|
#[fail(display = "{}", _0)]
|
||||||
WalkDir(#[fail(cause)] walkdir::Error),
|
WalkDir(#[fail(cause)] walkdir::Error),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue