add wrong usage exception

This commit is contained in:
crazywhalecc
2023-03-29 21:39:36 +08:00
parent d31e1b00e8
commit b0ac50941f
13 changed files with 67 additions and 18 deletions

View File

@@ -7,6 +7,7 @@ namespace SPC\builder\linux;
use JetBrains\PhpStorm\ArrayShape;
use SPC\builder\traits\UnixSystemUtilTrait;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
class SystemUtil
{
@@ -128,10 +129,10 @@ class SystemUtil
'clang' => match ($arch) {
'x86_64' => '--target=x86_64-unknown-linux',
'arm64', 'aarch64' => '--target=arm64-unknown-linux',
default => throw new RuntimeException('unsupported arch: ' . $arch),
default => throw new WrongUsageException('unsupported arch: ' . $arch),
},
'gcc' => '',
default => throw new RuntimeException('cc compiler ' . $cc . ' is not supported'),
default => throw new WrongUsageException('cc compiler ' . $cc . ' is not supported'),
};
}