Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tailhook
Last active September 21, 2015 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tailhook/bc9a70899494f27afc85 to your computer and use it in GitHub Desktop.
Save tailhook/bc9a70899494f27afc85 to your computer and use it in GitHub Desktop.
quick_error_primer
#[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
}
}
#[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