Skip to content

Instantly share code, notes, and snippets.

@tailhook
Created September 21, 2015 15:57
Show Gist options
  • Select an option

  • Save tailhook/317131ae8e0fc5c1cea1 to your computer and use it in GitHub Desktop.

Select an option

Save tailhook/317131ae8e0fc5c1cea1 to your computer and use it in GitHub Desktop.
quick-error-with-context
#[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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment