Log NamiException

This commit is contained in:
philipp lang 2021-06-21 18:57:38 +02:00
parent 27651ce006
commit e9cda2f67d
1 changed files with 8 additions and 0 deletions

View File

@ -4,6 +4,7 @@ namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable; use Throwable;
use Zoomyboy\LaravelNami\NamiException;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@ -36,6 +37,13 @@ class Handler extends ExceptionHandler
*/ */
public function report(Throwable $exception) public function report(Throwable $exception)
{ {
if (is_a($exception, NamiException::class)) {
\Log::error($exception->getMessage(), [
'request' => $exception->request,
'response' => $exception->response
]);
}
parent::report($exception); parent::report($exception);
} }