summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-05-06 09:42:14 +0300
committerLars Wirzenius <liw@liw.fi>2022-05-06 09:42:14 +0300
commit185377775aeeba57f91d6b40a8a599e840db1e90 (patch)
treed15fc0baf5926ab3bafef2bf6f9271751289d229 /src/error.rs
parentf42f4b2c27af2041436d681e4e292e549985066c (diff)
downloadsubplot-185377775aeeba57f91d6b40a8a599e840db1e90.tar.gz
refactor: replace SubplotError::RegexError with a simpler one
SubplotError::RegexError was a struct variant in the enum. Replace it with a more usual variant with the regex::Error as a source field, for better error messaging. Sponsored-by: author
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/error.rs b/src/error.rs
index 5286410..8fdaeee 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -291,12 +291,8 @@ pub enum SubplotError {
///
/// Subplot uses regular expressions. This is a generic wrapper for
/// any kinds of errors related to that.
- #[error(transparent)]
- RegexError {
- /// The wrapped error.
- #[from]
- source: regex::Error,
- },
+ #[error("Failed to compile regular expression: {0:?}")]
+ Regex(String, #[source] regex::Error),
/// JSON error
///