Add output_changed_message!, replace some .expects (#1110)

This commit is contained in:
Gideon
2025-04-13 10:43:08 +02:00
committed by GitHub
parent 801dddacd4
commit fd406f0f82
4 changed files with 37 additions and 26 deletions

View File

@@ -282,3 +282,15 @@ pub fn install_color_eyre() -> Result<()> {
.display_location_section(true)
.install()
}
/// Macro to construct an error message for when the output of a command is unexpected.
#[macro_export]
macro_rules! output_changed_message {
($command:expr, $message:expr) => {
format!(
"The output of `{}` changed: {}. This is not your fault, this is an issue in Topgrade. Please open an issue at: https://github.com/topgrade-rs/topgrade/issues/new?template=bug_report.md",
$command,
$message,
)
};
}