summaryrefslogtreecommitdiff
path: root/dhall/src/error.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-11 13:14:13 +0200
committerNadrieril2019-04-11 13:14:13 +0200
commitd3f14966120fae672dc890b718ebada74ebed533 (patch)
tree887b4af84bc2c69886616a4a9c8aa27fa846238a /dhall/src/error.rs
parent982f86c34f69bb78b45a4b8b37a5bf5731f881eb (diff)
parent82d62c4d7d423817a4fd9d6294d27d18d60bcd22 (diff)
Merge branch 'serde'
Diffstat (limited to '')
-rw-r--r--dhall/src/error.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/dhall/src/error.rs b/dhall/src/error.rs
new file mode 100644
index 0000000..cfd6f09
--- /dev/null
+++ b/dhall/src/error.rs
@@ -0,0 +1,32 @@
+use quick_error::quick_error;
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+quick_error! {
+ #[derive(Debug)]
+ pub enum Error {
+ IO(err: std::io::Error) {
+ from()
+ display("{}", err)
+ }
+ Parse(err: dhall_core::ParseError) {
+ from()
+ display("{}", err)
+ }
+ Decode(err: crate::binary::DecodeError) {
+ from()
+ display("{:?}", err)
+ }
+ Resolve(err: crate::imports::ImportError) {
+ from()
+ display("{}", err)
+ }
+ Typecheck(err: crate::typecheck::TypeError<dhall_core::X>) {
+ from()
+ display("{:?}", err)
+ }
+ Deserialize(err: String) {
+ display("{}", err)
+ }
+ }
+}