summaryrefslogtreecommitdiff
path: root/dhall/src/error
diff options
context:
space:
mode:
authorNadrieril Feneanar2020-03-05 16:20:07 +0000
committerGitHub2020-03-05 16:20:07 +0000
commit3f9194f47185fe30c9e410aa7c5e651df9694b3f (patch)
tree6d24b2e824822134da4976b65b413dc09ca4e567 /dhall/src/error
parent2ca97e97f1718141d826a78ab3da8197b2d55c69 (diff)
parent8e6b020ba1426c215382a81395b809b688fa7726 (diff)
Merge pull request #139 from Nadrieril/missing-features
Implement a bunch of missing features
Diffstat (limited to '')
-rw-r--r--dhall/src/error/mod.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs
index 8829d47..e28b98b 100644
--- a/dhall/src/error/mod.rs
+++ b/dhall/src/error/mod.rs
@@ -1,6 +1,6 @@
use std::io::Error as IOError;
-use crate::semantics::resolve::ImportStack;
+use crate::semantics::resolve::{ImportLocation, ImportStack};
use crate::syntax::{Import, ParseError};
mod builder;
@@ -26,8 +26,12 @@ pub(crate) enum ErrorKind {
#[derive(Debug)]
pub(crate) enum ImportError {
+ Missing,
+ MissingEnvVar,
+ SanityCheck,
UnexpectedImport(Import<()>),
- ImportCycle(ImportStack, Import<()>),
+ ImportCycle(ImportStack, ImportLocation),
+ Url(url::ParseError),
}
#[derive(Debug)]
@@ -109,6 +113,11 @@ impl From<ParseError> for Error {
ErrorKind::Parse(err).into()
}
}
+impl From<url::ParseError> for Error {
+ fn from(err: url::ParseError) -> Error {
+ ErrorKind::Resolve(ImportError::Url(err)).into()
+ }
+}
impl From<DecodeError> for Error {
fn from(err: DecodeError) -> Error {
ErrorKind::Decode(err).into()