diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 90c8a57e5dc5..0975b671227d 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -36,6 +36,7 @@ use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Illuminate\Validation\ValidationException; use Throwable; class Handler extends ExceptionHandler @@ -50,6 +51,7 @@ class Handler extends ExceptionHandler //Swift_TransportException::class, MaxAttemptsExceededException::class, CommandNotFoundException::class, + ValidationException::class, ]; /** diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index db3048a2f5fe..c3b283c4e56b 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -667,7 +667,10 @@ class SubscriptionService $client->company, ); - return $response; + if(is_array($body)) + return $response; + else + return ['message' => 'There was a problem encountered with the webhook', 'status_code' => 500]; } diff --git a/app/Utils/Traits/SubscriptionHooker.php b/app/Utils/Traits/SubscriptionHooker.php index 29f187bf4658..887913d51845 100644 --- a/app/Utils/Traits/SubscriptionHooker.php +++ b/app/Utils/Traits/SubscriptionHooker.php @@ -40,14 +40,13 @@ trait SubscriptionHooker RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false ]); - return array_merge($body, ['exception' => json_decode($response->getBody(),true), 'status_code' => $response->getStatusCode()]); + return json_decode($response->getBody(),true)); } catch(\Exception $e) { - //; - // dd($e); - $body = array_merge($body, ['exception' => ['message' => $e->getMessage(), 'status_code' => 500]]); - return $body; + + return ['message' => $e->getMessage(), 'status_code' => 500]; + } } diff --git a/resources/views/email/import/completed.blade.php b/resources/views/email/import/completed.blade.php index 951de9ea7674..58038b594a4f 100644 --- a/resources/views/email/import/completed.blade.php +++ b/resources/views/email/import/completed.blade.php @@ -70,9 +70,11 @@
{{ ctrans('texts.documents') }}: {{ count($company->documents) }}
@endif + @if($check_data)Data Quality:
{!! $check_data !!}
- + @endif + @if(!empty($errors) ){{ ctrans('texts.errors') }}: