mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
use solution repository instead of built-in (#209)
* use solution repository instead of built-in * suppress static analysis
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user