chiark / gitweb /
MaterialsFormatVersionError: Improve messages
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 May 2022 20:44:36 +0000 (21:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 May 2022 23:19:17 +0000 (00:19 +0100)
Well, I managed to produce these.  But the output was a bit ugly.

I think the stuff in Other about a "reasonable integer" is covered by
the specific strings we pass in the integer conversions, and there's
going to be a possibility of completely different kinds of problem:

Use of a format default in a builtin shape library is going to become
an error.  And we don't want to add a variant for it - that's
overkill.  So we'll reuse Other, and this message is not right.

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

index 79a64f4d7a88d6622244e191f417a7b3a7565852..645e1b49b6a954ef97f8b0b847274e887b5c01b8 100644 (file)
@@ -62,7 +62,7 @@ impl Version {
 pub enum VersionError {
   #[error("{0}")]
   Unsupported(#[from] Unsupported),
-  #[error("bad format version (must be a reasonable integer): {0}")]
+  #[error("bad format version: {0}")]
   Other(&'static str),
 }
 
index c723f8ca36c9384c84534196e09240b906efe4c9..83d39f92b4b5c50b10d7fdabfb5535d7aa1dd71f 100644 (file)
@@ -134,7 +134,7 @@ pub enum LibraryLoadError {
   #[error("{0}")]                       BadSubstitution(#[from] SubstError),
   #[error("{0}")] UnsupportedColourSpec(#[from] UnsupportedColourSpec),
   #[error("bad item name (invalid characters) in {0:?}")] BadItemName(String),
-  #[error("{0:?}")] MaterialsFormatVersionError(#[from] MFVE),
+  #[error("{0}")] MaterialsFormatVersionError(#[from] MFVE),
 
   #[error("group {group}: {error}")]
   InGroup { group: String, error: Box<LLE> },