Skip to content
Snippets Groups Projects
Commit 67a15dc4 authored by Patrick Kenny's avatar Patrick Kenny
Browse files

Issue #3448535 by ptmkenny: Log exceptions when the test form fails

parent e9226a80
Branches
Tags
1 merge request!19log send error exceptions
Pipeline #178065 passed
......@@ -6,6 +6,7 @@ namespace Drupal\firebase_php\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Utility\Error;
use Drupal\firebase_php\FirebasePhpMessagingApiInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -95,6 +96,7 @@ final class FirebasePhpSendTestMessageForm extends FormBase {
}
// @phpstan-ignore-next-line Exception is shown to admin, so no rethrowing.
catch (\Exception $e) {
Error::logException($this->logger('firebase_php'), $e);
$this->messenger()->addError($this->t('Failed to send the test message. Error: %error', [
'%error' => $e->getMessage(),
]));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment