From 83203e8f9a776bd82c5a70506b1c8d9b5c1e065f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Tobias=20de=20Freitas=20Neto?= Date: Tue, 5 Sep 2023 10:30:29 -0400 Subject: [PATCH] CustomExceptionHandler deve utlizar Throwable --- src/app/Exceptions/CustomExceptionHandler.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/Exceptions/CustomExceptionHandler.php b/src/app/Exceptions/CustomExceptionHandler.php index 8009f71..2da2625 100644 --- a/src/app/Exceptions/CustomExceptionHandler.php +++ b/src/app/Exceptions/CustomExceptionHandler.php @@ -3,7 +3,7 @@ namespace Ae3\LaravelLogsLayer\app\Exceptions; use Ae3\LaravelLogsLayer\app\Enums\LogsLevelsEnum; -use Exception; +use Throwable; use Ae3\LaravelLogsLayer\app\Traits\LogTrait; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Http\JsonResponse; @@ -27,11 +27,11 @@ class CustomExceptionHandler extends ExceptionHandler /** * Report or log an exception. * - * @param Exception $exception + * @param Throwable $exception * @return void * @throws InvalidArgumentException */ - public function report(Exception $exception) + public function report(Throwable $exception) { $level = $this->getExceptionLevel($exception); $this->logException(__METHOD__, $exception, $level); @@ -41,19 +41,19 @@ class CustomExceptionHandler extends ExceptionHandler * Render an exception into an HTTP response. * * @param Request $request - * @param Exception $exception + * @param Throwable $exception * @return JsonResponse|Response|\Symfony\Component\HttpFoundation\Response */ - public function render($request, Exception $exception) + public function render($request, Throwable $exception) { return parent::render($request, $exception); } /** - * @param Exception $exception + * @param Throwable $exception * @return string */ - protected function getExceptionLevel(Exception $exception): string + protected function getExceptionLevel(Throwable $exception): string { if (method_exists($exception, 'getLevel')) { return mb_strtolower($exception->getLevel());