Add compiler version & system information to panic error message

So that we stop constantly asking people about it.
This commit is contained in:
KtorZ
2023-10-06 14:45:25 +02:00
parent 524d0dadf5
commit a524836c94
3 changed files with 18 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ use aiken::cmd::{
packages::{self, add},
tx, uplc, Cmd,
};
use aiken_project::{config, pretty};
use owo_colors::OwoColorize;
@@ -54,18 +55,19 @@ fn panic_handler() {
let error_message = indoc::formatdoc! {
r#"{fatal}
Whoops! You found a bug in the Aiken compiler.
Please report this error at https://github.com/aiken-lang/aiken/issues/new.
In your bug report please provide the information below and if possible the code
that produced it.
{info}
{location}{message}"#,
{location}{message}"#,
info = config::compiler_info(),
fatal = "aiken::fatal::error".red().bold(),
location = location.purple(),
};
println!("{error_message}")
println!("\n{}", pretty::indent(&error_message, 3));
}));
}