Skip to content
Permalink
Browse files

Exit with error status on baseline read errors (#1866)

  • Loading branch information...
mpesari authored and muglug committed Jun 28, 2019
1 parent 5943f60 commit 3c61b178435d075c7308770548e08d1fe6a213ba
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/Psalm/ErrorBaseline.php
  2. +2 −1 src/psalm.php
@@ -63,7 +63,7 @@ public static function create(FileProvider $fileProvider, string $baselineFile,
public static function read(FileProvider $fileProvider, string $baselineFile): array
{
if (!$fileProvider->fileExists($baselineFile)) {
throw new Exception\ConfigException("{$baselineFile} does not exist or is not readable\n");
throw new Exception\ConfigException("{$baselineFile} does not exist or is not readable");
}
$xmlSource = $fileProvider->getContents($baselineFile);
@@ -730,7 +730,8 @@ function ($arg) {
(string)Config::getInstance()->error_baseline
);
} catch (\Psalm\Exception\ConfigException $exception) {
die('Error while reading baseline: ' . $exception->getMessage());
fwrite(STDERR, 'Error while reading baseline: ' . $exception->getMessage() . PHP_EOL);
exit(1);
}
}

0 comments on commit 3c61b17

Please sign in to comment.
You can’t perform that action at this time.