diff options
Diffstat (limited to 'src/fail.rs')
-rw-r--r-- | src/fail.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fail.rs b/src/fail.rs index 2c01885..1aa1d42 100644 --- a/src/fail.rs +++ b/src/fail.rs @@ -50,6 +50,8 @@ pub enum HError { HBoxWrongRatioError{ wnum: usize, ratio: Vec<usize> }, #[fail(display = "Got wrong widget: {}! Wanted: {}", got, wanted)] WrongWidgetError{got: String, wanted: String}, + #[fail(display = "Strip Prefix Error: {}", error)] + StripPrefixError{#[cause] error: std::path::StripPrefixError}, } impl HError { @@ -145,3 +147,10 @@ impl From<std::option::NoneError> for HError { HError::NoneError } } + +impl From<std::path::StripPrefixError> for HError { + fn from(error: std::path::StripPrefixError) -> Self { + dbg!(&error); + HError::StripPrefixError{error: error} + } +} |