Enhance exception handling by binding builder and extra info to ExceptionHandler

This commit is contained in:
crazywhalecc
2025-08-11 10:48:48 +08:00
parent 1e9434221b
commit 2fba61e9bd
5 changed files with 111 additions and 73 deletions

View File

@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace SPC\command;
use SPC\builder\BuilderProvider;
use SPC\exception\SPCException;
use SPC\exception\ExceptionHandler;
use SPC\store\Config;
use SPC\store\FileSystem;
use SPC\store\SourcePatcher;
@@ -165,8 +165,9 @@ class BuildPHPCommand extends BuildCommand
}
$this->printFormatInfo($this->getDefinedEnvs(), true);
$this->printFormatInfo($indent_texts);
// bind extra info to SPCException
SPCException::bindBuildPHPExtraInfo($indent_texts);
// bind extra info to exception handler
ExceptionHandler::$bind_build_php_extra_info = $indent_texts;
logger()->notice('Build will start after 2s ...');
sleep(2);