Skip to content

Commit

Permalink
fix human panic error
Browse files Browse the repository at this point in the history
  • Loading branch information
deepu105 committed Aug 28, 2024
1 parent 5bc74a5 commit 4433e6d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,10 @@ fn panic_hook(info: &PanicInfo<'_>) {
use human_panic::{handle_dump, print_msg, Metadata};
use log::error;

let meta = Metadata {
version: env!("CARGO_PKG_VERSION").into(),
name: env!("CARGO_PKG_NAME").into(),
authors: env!("CARGO_PKG_AUTHORS").replace(':', ", ").into(),
homepage: env!("CARGO_PKG_HOMEPAGE").into(),
};
let meta = Metadata::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))
.authors(env!("CARGO_PKG_AUTHORS").replace(':', ", "))
.homepage(env!("CARGO_PKG_HOMEPAGE"));

let file_path = handle_dump(&meta, info);
let (msg, location) = get_panic_info(info);
let stacktrace: String = format!("{:?}", Backtrace::new()).replace('\n', "\n\r");
Expand Down

0 comments on commit 4433e6d

Please sign in to comment.