feat: explicit DSN error if invalid

This commit is contained in:
Maël Gangloff
2024-08-18 18:37:45 +02:00
parent 3a53ffac1a
commit 16bcd3ac66

View File

@@ -69,7 +69,12 @@ class WatchListController extends AbstractController
$transportFactoryClass = $webhookScheme->getChatTransportFactory();
/** @var AbstractTransportFactory $transportFactory */
$transportFactory = new $transportFactoryClass();
$transportFactory->create($dsn)->send((new TestChatNotification())->asChatMessage());
try {
$transportFactory->create($dsn)->send((new TestChatNotification())->asChatMessage());
} catch (\Throwable $exception) {
throw new BadRequestHttpException($exception->getMessage());
}
}
}
}