summaryrefslogtreecommitdiffstats
path: root/src/watch/mirror.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/watch/mirror.rs')
-rw-r--r--src/watch/mirror.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/watch/mirror.rs b/src/watch/mirror.rs
index 6616bc1..924eb52 100644
--- a/src/watch/mirror.rs
+++ b/src/watch/mirror.rs
@@ -3,7 +3,7 @@ use std::path::Path;
use crate::config::Config;
use crate::db::{self, Db};
-use crate::error::{Error, Result};
+use crate::error::{Error, Missing, Result};
use crate::git;
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -41,7 +41,7 @@ pub fn sync_mirror(cfg: &Config, db: &Db, name: &str, url: &str) -> Result<Sync>
}
fn record(db: &Db, name: &str, head: &str, mirror: &Path) -> Result<()> {
- let pb = db::get_pkgbase(db, name)?.ok_or_else(|| Error::not_found(format!("pkgbase {name}")))?;
+ let pb = db::get_pkgbase(db, name)?.ok_or_else(|| Error::not_found(Missing::Pkgbase(name.to_string())))?;
db::set_aur_head(&db.writer, pb.id, head, &mirror.display().to_string())
}
@@ -89,7 +89,7 @@ pub fn read_tree(mirror: &Path, commit: &str) -> Result<Tree> {
for (path, sha) in &blobs {
let bytes = contents
.get(sha)
- .ok_or_else(|| Error::not_found(format!("{path} not in mirror")))?;
+ .ok_or_else(|| Error::not_found(Missing::MirrorPath(path.to_string())))?;
if bytes.len() > 4 * 1024 * 1024 || !looks_textual(bytes) {
continue;
}