diff --git a/src/Actions/TranslatableAction.php b/src/Actions/TranslatableAction.php index 26b2952..1ab9272 100644 --- a/src/Actions/TranslatableAction.php +++ b/src/Actions/TranslatableAction.php @@ -47,10 +47,9 @@ function (Field $component) { } else { $text = $component->getState(); } - - $googleTranslate = $googleTranslate->translate($source, $data['target'], $text); - + try { + $googleTranslate = $googleTranslate->translate($source, $data['target'], $text); $component->state($googleTranslate); $livewire->dispatch('refresh-tiptap-editors', [ @@ -66,7 +65,7 @@ function (Field $component) { } catch (\Exception $exception) { Notification::make() ->title(__('filament-translate-action::filament-translate-action.error_title')) - ->body(__('filament-translate-action::filament-translate-action.error_message')) + ->body(__('filament-translate-action::filament-translate-action.error_message'). '
' . $exception->getMessage()) ->danger() ->send();