添加 app/ExceptionHandler.php
This commit is contained in:
parent
1fcf8f46ec
commit
d0db2ec253
23
app/ExceptionHandler.php
Normal file
23
app/ExceptionHandler.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
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
|
||||
{
|
||||
if ($exception instanceof Dumper) {
|
||||
return \response(self::convertToHtml($exception));
|
||||
}
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user