diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 1b5674d7..9f14437d 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -6,6 +6,7 @@ use Illuminate\Auth\AuthenticationException; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Validation\ValidationException; +use Overtrue\EasySms\Exceptions\NoGatewayAvailableException; use Symfony\Component\HttpKernel\Exception\HttpException; use Throwable; @@ -64,6 +65,14 @@ class Handler extends ExceptionHandler return new HttpException(404, __(':resource not found', ['resource' => $resource]), $e); }); + $this->reportable(function (NoGatewayAvailableException $e) { + foreach ($e->getExceptions() as $exception) { + $this->report($exception); + } + + return false; + }); + $this->renderable(function (BizException $e, $request) { if ($this->shouldReturnJson($request, $e)) { return response()->json($this->convertExceptionToArray($e), $e->status);