Command: fail() should show a readable message

fixes #2567
This commit is contained in:
Thomas Gelf 2022-07-20 06:44:41 +02:00
parent 0a25e256d1
commit 164d1f5874
2 changed files with 7 additions and 2 deletions

View File

@ -28,6 +28,7 @@ v1.10.0 (unreleased)
* FIX: config deploy doesn't try to wait in case of no deployment (#2522)
* FEATURE: improved wording for deployment error messages (#2523)
* FEATURE: JSON can now be shipped via STDIN (#1570)
* FEATURE: improved readability for some error messages (#2567)
1.9.1
-----

View File

@ -38,6 +38,10 @@ class Command extends CliCommand
}
}
/**
* @param string $msg
* @return never-return
*/
public function fail($msg)
{
$args = func_get_args();
@ -45,8 +49,8 @@ class Command extends CliCommand
if (count($args)) {
$msg = vsprintf($msg, $args);
}
throw new RuntimeException($msg);
echo $this->screen->colorize("ERROR", 'red') . ": $msg\n";
exit(1);
}
/**