Add output_changed_message!, replace some .expects (#1110)
This commit is contained in:
12
src/utils.rs
12
src/utils.rs
@@ -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,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user