Add custom panic hook

The panic hook prints a backtrace, the panic message, file, and line
number, and a plea to report bugs.
This commit is contained in:
Brian Anderson
2017-07-03 06:31:29 +01:00
parent 4c32177ef3
commit 6345b54034
11 changed files with 120 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ serde = "1.0"
serde_derive = "1.0"
docopt = "0.8"
ethstore = { path = "../" }
panic_hook = { path = "../../panic_hook" }
[[bin]]
name = "ethstore"

View File

@@ -20,6 +20,7 @@ extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate ethstore;
extern crate panic_hook;
use std::{env, process, fs, fmt};
use std::io::Read;
@@ -134,6 +135,8 @@ impl fmt::Display for Error {
}
fn main() {
panic_hook::set();
match execute(env::args()) {
Ok(result) => println!("{}", result),
Err(err) => {