erp_old/app/ExceptionHandler.php

25 lines
540 B
PHP
Raw Normal View History

2024-04-26 11:26:12 +08:00
<?php
namespace App;
2024-05-10 17:56:02 +08:00
use app\common\service\JsonService;
2024-04-26 11:26:12 +08:00
use Next\VarDumper\Dumper;
use Next\VarDumper\DumperHandler;
use support\exception\Handler;
use Throwable;
use Webman\Http\Request;
use Webman\Http\Response;
class ExceptionHandler extends Handler
{
use DumperHandler;
public function render(Request $request, Throwable $exception): Response
{
2024-05-11 13:46:55 +08:00
if ($exception instanceof Dumper) {
return \response(self::convertToHtml($exception));
}
return parent::render($request, $exception);
2024-04-26 11:26:12 +08:00
}
}