summaryrefslogtreecommitdiff
path: root/dhall/src
diff options
context:
space:
mode:
authorNadrieril2020-04-14 22:36:40 +0100
committerNadrieril2020-06-24 22:13:53 +0100
commit42a9e687e3ecd157779236e893d5564a119dce31 (patch)
treeedd1020314567c2c41b150f53df580e181b956ec /dhall/src
parentd99bd58171dfb07cbc7979d093fbc94a74afa0f9 (diff)
test: use errors instead of panics to signify test failure
Diffstat (limited to 'dhall/src')
-rw-r--r--dhall/src/error/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs
index 0cfa93c..d533264 100644
--- a/dhall/src/error/mod.rs
+++ b/dhall/src/error/mod.rs
@@ -92,6 +92,17 @@ impl std::fmt::Display for TypeError {
impl std::error::Error for TypeError {}
+impl std::fmt::Display for EncodeError {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ let msg = match self {
+ EncodeError::CBORError(e) => format!("Encode error: {}", e),
+ };
+ write!(f, "{}", msg)
+ }
+}
+
+impl std::error::Error for EncodeError {}
+
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match &self.kind {