From 962d5672f6dd1912b2e8db188b6137f02cecfda1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 11 May 2022 21:44:36 +0100 Subject: [PATCH] MaterialsFormatVersionError: Improve messages 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 --- src/materials-format.rs | 2 +- src/shapelib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/materials-format.rs b/src/materials-format.rs index 79a64f4d..645e1b49 100644 --- a/src/materials-format.rs +++ b/src/materials-format.rs @@ -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), } diff --git a/src/shapelib.rs b/src/shapelib.rs index c723f8ca..83d39f92 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -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 }, -- 2.30.2