diff options
Diffstat (limited to 'dhall/src/error')
-rw-r--r-- | dhall/src/error/mod.rs | 13 |
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() |