From 7c7dedf126229fb7eb52dc6d64d2618729bd9e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Mon, 21 Jul 2025 14:55:23 +0200 Subject: [PATCH] Make error message nicer when bors service panics in tests --- src/tests/mocks/bors.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/mocks/bors.rs b/src/tests/mocks/bors.rs index 492c45fb..f885425a 100644 --- a/src/tests/mocks/bors.rs +++ b/src/tests/mocks/bors.rs @@ -86,7 +86,11 @@ impl BorsBuilder { match result { Ok(res) => match res { - Ok(_) => gh_state.expect("Bors service has failed"), + Ok(_) => gh_state + .context("Bors service has failed") + // This makes the error nicer + .map_err(|e| e.to_string()) + .unwrap(), Err(error) => { panic!( "Test has failed: {error:?}\n\nBors service error: {:?}",