summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 526b6ce..0249d7f 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -155,3 +155,15 @@ impl Error {
&self.e
}
}
+
+impl std::fmt::Display for Error {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "failed to parse {}: {}", self.input, self.e)
+ }
+}
+
+impl std::error::Error for Error {
+ fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
+ Some(&*self.e)
+ }
+}