chiark / gitweb /
libraries: LibraryItemNotPrepared: Make this a separate error
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 May 2021 13:07:29 +0000 (14:07 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 May 2021 15:08:47 +0000 (16:08 +0100)
This is going to be important when uploadable shapes need separate
preparation.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib.rs
src/spec.rs

index 0a5ca5d0ceb75dda50e76e3c8ef20809fff15434..145bd5b8dcb3e0e459b3b9f43107f0336b3b1d48 100644 (file)
@@ -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,
       };
index 36acfa83f10f1cc57fc48b9278607b3e8159eb6f..b5e61fa096ab44354ecc565b83d794c52066cf6a 100644 (file)
@@ -67,6 +67,7 @@ pub enum SpecError {
   PosOffTable,
   LibraryNotFound,
   LibraryItemNotFound(ItemSpec),
+  LibraryItemNotPrepared(ItemSpec),
   AclInvalidAccountGlob,
   AclEntryOverlappingAllowDeny,
   InconsistentPieceCount,