Refactor all exception classes, remove unclear RuntimeException, InvalidArgumentException

This commit is contained in:
crazywhalecc
2025-08-06 20:21:09 +08:00
committed by Jerry Ma
parent 0c9a30256e
commit cc447a089a
13 changed files with 383 additions and 19 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace SPC\exception;
/**
* EnvironmentException is thrown when there is an issue with the environment setup,
* such as missing dependencies or incorrect configurations.
*/
class EnvironmentException extends SPCException
{
public function __construct(string $message, private readonly ?string $solution = null)
{
parent::__construct($message);
}
/**
* Returns the solution for the environment issue.
*/
public function getSolution(): ?string
{
return $this->solution;
}
}