Fix error handling in loadFromFile methods and update exception types in tests

This commit is contained in:
crazywhalecc
2025-12-10 11:33:39 +08:00
parent bde1440617
commit 020a30315d
5 changed files with 14 additions and 14 deletions

View File

@@ -31,7 +31,7 @@ class ArtifactConfig
*/
public static function loadFromFile(string $file): void
{
$content = file_get_contents($file);
$content = @file_get_contents($file);
if ($content === false) {
throw new WrongUsageException("Failed to read artifact config file: {$file}");
}

View File

@@ -38,7 +38,7 @@ class PackageConfig
*/
public static function loadFromFile(string $file): void
{
$content = file_get_contents($file);
$content = @file_get_contents($file);
if ($content === false) {
throw new WrongUsageException("Failed to read package config file: {$file}");
}