From dc9669ceb980c42f5565455a7aeecca6fbbebed9 Mon Sep 17 00:00:00 2001 From: dalance Date: Tue, 17 Sep 2019 18:58:17 +0900 Subject: [PATCH] Update error --- sv-parser-error/Cargo.toml | 2 +- sv-parser-error/src/lib.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sv-parser-error/Cargo.toml b/sv-parser-error/Cargo.toml index 25869ed..354f8ac 100644 --- a/sv-parser-error/Cargo.toml +++ b/sv-parser-error/Cargo.toml @@ -7,4 +7,4 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -failure = "*" +failure = "0.1.5" diff --git a/sv-parser-error/src/lib.rs b/sv-parser-error/src/lib.rs index d211f8b..748a4c6 100644 --- a/sv-parser-error/src/lib.rs +++ b/sv-parser-error/src/lib.rs @@ -2,6 +2,7 @@ use failure::{Backtrace, Context, Fail}; use std::fmt; use std::fmt::Display; use std::io::Error as IOError; +use std::path::PathBuf; // ----------------------------------------------------------------------------- @@ -9,8 +10,14 @@ use std::io::Error as IOError; pub enum ErrorKind { #[fail(display = "IO error")] Io, + #[fail(display = "File error: {:?}", _0)] + File(PathBuf), + #[fail(display = "Include error")] + Include, #[fail(display = "Parse error")] Parse, + #[fail(display = "Preprocess error")] + Preprocess, } // -----------------------------------------------------------------------------