use solution repository instead of built-in (#209)

* use solution repository instead of built-in

* suppress static analysis
This commit is contained in:
sunxyw
2022-12-27 20:39:24 +08:00
committed by GitHub
parent 05b3321af7
commit 87840930e0
13 changed files with 75 additions and 30 deletions

View File

@@ -5,22 +5,23 @@ declare(strict_types=1);
namespace ZM\Exception;
use OneBot\Exception\ExceptionHandler;
use OneBot\Exception\ExceptionHandlerInterface;
use ZM\Exception\Solution\SolutionRepository;
class Handler extends ExceptionHandler implements ExceptionHandlerInterface
class Handler extends ExceptionHandler
{
public function __construct()
{
parent::__construct();
/** @noinspection ClassConstantCanBeUsedInspection */
$ns = 'NunoMaduro\Collision\Handler';
// TODO: 在 LibOB 发布新版时移除检查
if (class_exists($ns) && method_exists($this, 'tryEnableCollision')) {
$this->tryEnableCollision(new SolutionRepository());
}
}
public function handle(\Throwable $e): void
{
if ($e instanceof ZMKnownException) {
// 如果是已知异常,则可以输出问题说明和解决方案
// TODO
}
$this->handle0($e);
}
}