From: Ian Jackson Date: Wed, 5 May 2021 13:07:29 +0000 (+0100) Subject: libraries: LibraryItemNotPrepared: Make this a separate error X-Git-Tag: otter-0.6.0~372 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f580502d464611e7c0a5c3085f5a9be71979bfdf;p=otter.git libraries: LibraryItemNotPrepared: Make this a separate error This is going to be important when uploadable shapes need separate preparation. Signed-off-by: Ian Jackson --- diff --git a/src/shapelib.rs b/src/shapelib.rs index 0a5ca5d0..145bd5b8 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -377,7 +377,7 @@ impl Contents { warn!("library item lib={} itme={} for={:?} data file {:?} not found", &self.libname, item_name, item_for, &svg_path); let spec_for = ItemSpec::from_strs(lib_name_for, item_for); - SpE::LibraryItemNotFound(spec_for) + SpE::LibraryItemNotPrepared(spec_for) } else { let m = "error accessing/reading library item data file"; error!("{}: {} {:?}: {}", &m, &svg_path, item_for, &e); @@ -478,6 +478,7 @@ impl Contents { self.load1(v, &self.libname, k.as_str(), &default()) { Err(SpecError::LibraryItemNotFound(_)) => continue, + Err(SpecError::LibraryItemNotPrepared(_)) => continue, e@ Err(_) => e?, Ok(r) => r, }; diff --git a/src/spec.rs b/src/spec.rs index 36acfa83..b5e61fa0 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -67,6 +67,7 @@ pub enum SpecError { PosOffTable, LibraryNotFound, LibraryItemNotFound(ItemSpec), + LibraryItemNotPrepared(ItemSpec), AclInvalidAccountGlob, AclEntryOverlappingAllowDeny, InconsistentPieceCount,