]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/SettingController.php
added api functionality to handle book Shelves
[bookstack] / app / Http / Controllers / SettingController.php
index 892b2d9cf0e0b5c7f9dd174e552a640790d191e7..00dd60ac759b5a005522c2e7b2b504a36bfa9107 100644 (file)
@@ -122,8 +122,14 @@ class SettingController extends Controller
     {
         $this->checkPermission('settings-manage');
 
-        user()->notify(new TestEmail());
-        $this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email]));
+        try {
+            user()->notify(new TestEmail());
+            $this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email]));
+        } catch (\Exception $exception) {
+            $errorMessage = trans('errors.maintenance_test_email_failure') . "\n" . $exception->getMessage();
+            $this->showErrorNotification($errorMessage);
+        }
+
 
         return redirect('/settings/maintenance#image-cleanup')->withInput();
     }