* @copyright walkor * @link http://www.workerman.net/ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ namespace support\exception; use Throwable; use Webman\Exception\ExceptionHandler; use Webman\Http\Request; use Webman\Http\Response; /** * Class Handler * @package support\exception */ class Handler extends ExceptionHandler { public $dontReport = [ BusinessException::class, ]; public function report(Throwable $exception) { parent::report($exception); } public function render(Request $request, Throwable $exception): Response { if(($exception instanceof BusinessException) && ($response = $exception->render($request))) { return $response; } return parent::render($request, $exception); } }