From b382ffbbbe3c57358b63a9cb95d7b844f31f5f61 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 12 May 2021 22:22:18 -0400 Subject: [PATCH] Improve serialization error messages --- src/calc/errors.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calc/errors.rs b/src/calc/errors.rs index 9f537c2..9c52c05 100644 --- a/src/calc/errors.rs +++ b/src/calc/errors.rs @@ -39,8 +39,10 @@ impl fmt::Display for CalculatorError { CalculatorError::ParseError => write!(f, "Parse error"), CalculatorError::PrecisionTooHigh => write!(f, "Precision too high"), CalculatorError::SaveError(None) => write!(f, "Could not save"), + CalculatorError::SaveError(Some(ConfyError::SerializeTomlError(e))) => write!(f, "Save serialization error: {}", e), CalculatorError::SaveError(Some(e)) => write!(f, "Could not save: {}", e), CalculatorError::LoadError(None) => write!(f, "Could not load"), + CalculatorError::LoadError(Some(ConfyError::SerializeTomlError(e))) => write!(f, "Load serialization error: {}", e), CalculatorError::LoadError(Some(e)) => write!(f, "Could not load: {}", e), } }