From 33ebceef876d7e2bdf6245a1efe825f8ef58d54f Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 2 Aug 2023 11:43:39 +0100 Subject: [PATCH] chore: create a const to hold the panic message --- crates/nargo_cli/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/nargo_cli/src/main.rs b/crates/nargo_cli/src/main.rs index a73785c64c6..a79c43dad48 100644 --- a/crates/nargo_cli/src/main.rs +++ b/crates/nargo_cli/src/main.rs @@ -3,12 +3,12 @@ use color_eyre::{config::HookBuilder, eyre}; use nargo_cli::cli::start_cli; +const PANIC_MESSAGE: &str = "This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.\nIf there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml"; + fn main() -> eyre::Result<()> { // Register a panic hook to display more readable panic messages to end-users - let (panic_hook, _) = HookBuilder::default() - .display_env_section(false) - .panic_section("This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.\nIf there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml") - .into_hooks(); + let (panic_hook, _) = + HookBuilder::default().display_env_section(false).panic_section(PANIC_MESSAGE).into_hooks(); panic_hook.install(); start_cli()