Add simple output handling to exception classes

This commit is contained in:
crazywhalecc
2026-02-28 13:43:28 +08:00
parent d316684995
commit 2d550a8db4
4 changed files with 24 additions and 3 deletions

View File

@@ -20,6 +20,8 @@ use StaticPHP\Package\TargetPackage;
*/
abstract class SPCException extends \Exception
{
protected bool $simple_output = false;
/** @var null|array Package information */
private ?array $package_info = null;
@@ -155,6 +157,16 @@ abstract class SPCException extends \Exception
return $this->extra_log_files;
}
public function isSimpleOutput(): bool
{
return $this->simple_output;
}
public function setSimpleOutput(bool $simple_output = true): void
{
$this->simple_output = $simple_output;
}
/**
* Load stack trace information to detect Package, Builder, and Installer context.
*/