From 4cf767ae210d5b92531283b16a3a49467c828c89 Mon Sep 17 00:00:00 2001 From: Emma Fabre Date: Mon, 20 Jan 2025 15:18:32 +0100 Subject: [PATCH] Don't just log but also capture Keycloak exceptions during client creation --- app/Keycloak/Listeners/CreateClients.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Keycloak/Listeners/CreateClients.php b/app/Keycloak/Listeners/CreateClients.php index 1259a6053..35e27b85a 100644 --- a/app/Keycloak/Listeners/CreateClients.php +++ b/app/Keycloak/Listeners/CreateClients.php @@ -19,6 +19,7 @@ use Illuminate\Contracts\Queue\ShouldQueue; use Psr\Log\LoggerInterface; use Throwable; +use function Sentry\captureException; final class CreateClients implements ShouldQueue { @@ -88,6 +89,7 @@ private function createClientsInKeycloak(Integration $integration, Realms $realm $clientCollection->add($client); } catch (KeyCloakApiFailed $e) { + captureException($e); $this->logger->error($e->getMessage()); } }