diff options
author | Nadrieril | 2020-05-17 17:05:25 +0100 |
---|---|---|
committer | GitHub | 2020-05-17 17:05:25 +0100 |
commit | aaba9f7a1a6119443aa6a569e451e0e549e5bb37 (patch) | |
tree | 5672d51e4197ae465b19222abb1dfca9d7e0040f /dhall/src/error | |
parent | fcce380d5b4588dc5934bc2e5448d1d981761b50 (diff) | |
parent | 6c26ae4aa828b8054b307033dc58a6dfb4dac1a0 (diff) |
Merge pull request #165 from fteychene/feat/resolve_cache
Diffstat (limited to 'dhall/src/error')
-rw-r--r-- | dhall/src/error/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs index ef4d41f..0cfa93c 100644 --- a/dhall/src/error/mod.rs +++ b/dhall/src/error/mod.rs @@ -22,6 +22,7 @@ pub enum ErrorKind { Encode(EncodeError), Resolve(ImportError), Typecheck(TypeError), + Cache(CacheError), } #[derive(Debug)] @@ -57,6 +58,13 @@ pub enum TypeMessage { Custom(String), } +#[derive(Debug)] +pub enum CacheError { + MissingConfiguration, + InitialisationError { cause: IOError }, + CacheHashInvalid, +} + impl Error { pub fn new(kind: ErrorKind) -> Self { Error { kind } @@ -93,6 +101,7 @@ impl std::fmt::Display for Error { ErrorKind::Encode(err) => write!(f, "{:?}", err), ErrorKind::Resolve(err) => write!(f, "{:?}", err), ErrorKind::Typecheck(err) => write!(f, "{}", err), + ErrorKind::Cache(err) => write!(f, "{:?}", err), } } } @@ -138,3 +147,8 @@ impl From<TypeError> for Error { ErrorKind::Typecheck(err).into() } } +impl From<CacheError> for Error { + fn from(err: CacheError) -> Error { + ErrorKind::Cache(err).into() + } +} |