diff options
Diffstat (limited to 'src/fail.rs')
-rw-r--r-- | src/fail.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fail.rs b/src/fail.rs index 97cbd62..580aad1 100644 --- a/src/fail.rs +++ b/src/fail.rs @@ -69,9 +69,14 @@ pub enum HError { WidgetUndefinedKeyError{key: Key}, #[fail(display = "Terminal has been resized!")] TerminalResizedError, + #[fail(display = "{}", _0)] + Log(String) } impl HError { + pub fn log(log: String) -> HResult<()> { + Err(HError::Log(log)) + } pub fn quit() -> HResult<()> { Err(HError::Quit) } |