Fix workaround for #17491 log error on failed response for mail sending

* Part of bunch of fixes, this fix #17491 where admins at test install cannot see the log of errors for UI test mail button, we can just see that this is the correct form cos other parts of the code manage the exception inside the catch using log interface class
This commit is contained in:
Герхард PICCORO Lenz McKAY
2025-08-07 11:42:17 -04:00
committed by GitHub
parent 2afc595452
commit f4be5ffb5d
@@ -150,8 +150,11 @@ class SettingsController extends Controller
if (!config('app.lock_passwords')) {
try {
Notification::send(Setting::first(), new MailTest());
Log::debug('Mail sending to '.config('mail.reply_to.address'));
return response()->json(['message' => 'Mail sent to '.config('mail.reply_to.address')], 200);
} catch (\Exception $e) {
Log::debug($e);
Log::error('Mail sent to '.config('mail.reply_to.address') . $e->getMessage());
return response()->json(['message' => $e->getMessage()], 500);
}
}
@@ -315,4 +318,4 @@ class SettingsController extends Controller
}
}
}