Skip to content

Commit

Permalink
Catch any error in config.php
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Mar 14, 2024
1 parent a3d3470 commit eaf4552
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/composer-dependency-analyser
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $printer = new Printer($cwd === false ? '' : $cwd);
* @return never
*/
$exit = static function (string $message) use ($printer): void {
$printer->printLine("<red>$message</red>" . PHP_EOL);
$printer->printLine("\n<red>$message</red>" . PHP_EOL);
exit(255);
};

Expand Down Expand Up @@ -117,6 +117,8 @@ if (is_file($configPath)) {
$config = require $configPath;
} catch (OurRuntimeException $e) {
$exit($e->getMessage());
} catch (Throwable $e) {
$exit(get_class($e) . " in {$e->getFile()}:{$e->getLine()}\n > " . $e->getMessage());
}

if (!$config instanceof Configuration) {
Expand Down

0 comments on commit eaf4552

Please sign in to comment.