Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
--- examples/context.rs 2016-06-17 00:55:28.578244188 +0300
+++ examples/backtrace.rs 2016-06-17 00:59:10.613723109 +0300
@@ -1,4 +1,5 @@
#[macro_use(quick_error)] extern crate quick_error;
+extern crate backtrace;
use std::io::{self, stderr, Read, Write};
use std::fs::File;
@@ -7,6 +8,7 @@
use std::path::{Path, PathBuf};
use quick_error::ResultExt;
+use backtrace::Backtrace;
quick_error! {
#[derive(Debug)]
@@ -14,10 +16,10 @@
NoFileName {
description("no file name specified")
}
- Io(err: io::Error, path: PathBuf) {
- display("could not read file {:?}: {}", path, err)
+ Io(err: io::Error, path: PathBuf, tb: Backtrace) {
+ display("could not read file {:?}: {}\n{:?}", path, err, tb)
context(path: &'a Path, err: io::Error)
- -> (err, path.to_path_buf())
+ -> (err, path.to_path_buf(), Backtrace::new())
}
Parse(err: ParseIntError, path: PathBuf) {
display("could not parse file {:?}: {}", path, err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment