diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-05-06 09:30:27 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-05-06 09:34:28 +0300 |
commit | f42f4b2c27af2041436d681e4e292e549985066c (patch) | |
tree | 3f689eaee73afa054ccb86de9c5544c8263f97c1 /src/error.rs | |
parent | 2a452b2d2f4fba6f840e2ea33123002ae58e88b2 (diff) | |
download | subplot-f42f4b2c27af2041436d681e4e292e549985066c.tar.gz |
refactor: replace SubplotError::YamlError with more specific one
SubplotError::YamlError is quite generic. We only parse YAML as part
of document metadata, so replace the error with a more specific one.
Sponsored-by: author
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/error.rs b/src/error.rs index 1b95f1c..5286410 100644 --- a/src/error.rs +++ b/src/error.rs @@ -309,16 +309,9 @@ pub enum SubplotError { source: serde_json::Error, }, - /// YAML error - /// - /// Subplot parses YAML. This is a generic wrapper for any kinds - /// of errors related to that. - #[error(transparent)] - YamlError { - /// The wrapped error. - #[from] - source: serde_yaml::Error, - }, + /// Error parsing YAML metadata for document. + #[error("Failed to parse YAML metadata")] + Metadata(#[source] serde_yaml::Error), /// Abstract syntax tree error. #[error(transparent)] |