summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
authorNadrieril2019-03-24 22:29:52 +0100
committerNadrieril2019-03-24 22:30:47 +0100
commit2a2f3c662f0e62584a8f7a535c3cde30a53d8b0b (patch)
tree22f116a8795184c35c802d0c4117e799f36cbc8d /dhall
parent7d5ad4ce79b3e69afd6461d5b81ab095bd04d651 (diff)
Improve decoder errors on unknown inputs
Diffstat (limited to 'dhall')
-rw-r--r--dhall/src/binary.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs
index eb96da2..235a55b 100644
--- a/dhall/src/binary.rs
+++ b/dhall/src/binary.rs
@@ -323,13 +323,9 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> {
let y = cbor_value_to_dhall(&y)?;
Annot(x, y)
}
- [U64(t), ..] => Err(DecodeError::WrongFormatError(format!(
- "unknown tag: {}",
- t
- )))?,
- _ => Err(DecodeError::WrongFormatError("array".to_owned()))?,
+ _ => Err(DecodeError::WrongFormatError(format!("{:?}", data)))?,
},
- _ => Err(DecodeError::WrongFormatError("unknown type".to_owned()))?,
+ _ => Err(DecodeError::WrongFormatError(format!("{:?}", data)))?,
}))
}