summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-01-19 08:34:15 +0200
committerLars Wirzenius <liw@liw.fi>2021-01-19 08:40:02 +0200
commit7391e26d18eb6833a6191e6359346f3c0c502607 (patch)
treec5610dbbb0e568a878c2e18c01d5aaaef2c7639a /src/error.rs
parent6fa225df872ea63ddeffbc017f30c0eb96feb8ce (diff)
downloadobnam2-7391e26d18eb6833a6191e6359346f3c0c502607.tar.gz
refactor: use ChunkId directly in errors, instead of String
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/error.rs b/src/error.rs
index a35a99c..d368763 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,3 +1,4 @@
+use crate::chunkid::ChunkId;
use std::path::PathBuf;
use thiserror::Error;
@@ -11,14 +12,14 @@ pub enum ObnamError {
TooManyFiles(PathBuf),
#[error("Server response did not have a 'chunk-meta' header for chunk {0}")]
- NoChunkMeta(String),
+ NoChunkMeta(ChunkId),
#[error("Wrong checksum for chunk {0}, got {1}, expected {2}")]
- WrongChecksum(String, String, String),
+ WrongChecksum(ChunkId, String, String),
#[error("Chunk is missing: {0}")]
- MissingChunk(String),
+ MissingChunk(ChunkId),
#[error("Chunk is in store too many times: {0}")]
- DuplicateChunk(String),
+ DuplicateChunk(ChunkId),
}