diff --git a/Helper/Data.php b/Helper/Data.php index d4f0aee..87c533f 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -365,7 +365,7 @@ public function isActiveWithReason(): array $config = $this->collectModuleConfig(); $emptyConfig = empty($config); $configEnabled = isset($config['enabled']) && $config['enabled']; - $dsnNotEmpty = $this->getDSN(); + $dsn = $this->getDSN(); $productionMode = ($this->isProductionMode() || $this->isOverwriteProductionMode()); if ($emptyConfig) { @@ -374,9 +374,16 @@ public function isActiveWithReason(): array if (!$configEnabled) { $reasons[] = __('Module is not enabled in config.'); } - if (!$dsnNotEmpty && !$this->isSpotlightEnabled()) { + if (!$dsn && !$this->isSpotlightEnabled()) { $reasons[] = __('DSN is empty.'); } + if ($dsn) { + try { + \Sentry\Dsn::createFromString($dsn); + } catch (\InvalidArgumentException $e) { + $reasons[] = $e->getMessage(); + } + } if (!$productionMode) { $reasons[] = __('Not in production and development mode is false.'); }