mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 15:41:36 +03:00
some compiler lib cleanup
This commit is contained in:
parent
d43fd813f7
commit
5129276a4b
@ -17,6 +17,9 @@ include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ]
|
||||
license = "GPL-3.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
backtrace = "0.3.65"
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0"
|
||||
features = [ "derive" ]
|
||||
@ -64,4 +67,4 @@ path = "../../leo/errors"
|
||||
version = "1.5.3"
|
||||
|
||||
[dependencies.regex]
|
||||
version = "1.5"
|
||||
version = "1.5"
|
||||
|
@ -57,7 +57,14 @@ fn set_hook() -> Arc<Mutex<Option<String>>> {
|
||||
let panic_buf = panic_buf.clone();
|
||||
Box::new(move |e| {
|
||||
if thread::current().id() == thread_id {
|
||||
*panic_buf.lock().unwrap() = Some(e.to_string());
|
||||
if !std::env::var("RUST_BACKTRACE")
|
||||
.unwrap_or_else(|_| "".to_string())
|
||||
.is_empty()
|
||||
{
|
||||
*panic_buf.lock().unwrap() = Some(format!("{:?}", backtrace::Backtrace::new()));
|
||||
} else {
|
||||
*panic_buf.lock().unwrap() = Some(e.to_string());
|
||||
}
|
||||
} else {
|
||||
println!("{}", e)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user