Last active
September 21, 2015 15:55
-
-
Save tailhook/bc9a70899494f27afc85 to your computer and use it in GitHub Desktop.
quick_error_primer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] extern crate quick_error; | |
quick_error! { | |
#[derive(Debug)] | |
pub enum SomeError { | |
Io(err: io::Error, path: PathBuf) { | |
display("I/O error at {path}: {err}", err=err, path=path) | |
description(err.description()) | |
} | |
ApplicationError | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] extern crate quick_error; | |
quick_error! { | |
#[derive(Debug)] | |
pub enum SomeError { | |
Io(err: io::Error) { | |
from() | |
display("I/O error: {}", err) | |
description(err.description()) | |
} | |
ApplicationError | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment