Skip to content

Commit 3f52221

Browse files
Remove full DSNs from exception messages
1 parent 671769f commit 3f52221

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Session/Storage/Handler/SessionHandlerFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function createHandler($connection): AbstractSessionHandler
6363
case str_starts_with($connection, 'rediss:'):
6464
case str_starts_with($connection, 'memcached:'):
6565
if (!class_exists(AbstractAdapter::class)) {
66-
throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection));
66+
throw new \InvalidArgumentException('Unsupported Redis or Memcached DSN. Try running "composer require symfony/cache".');
6767
}
6868
$handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class;
6969
$connection = AbstractAdapter::createConnection($connection, ['lazy' => true]);
@@ -72,7 +72,7 @@ public static function createHandler($connection): AbstractSessionHandler
7272

7373
case str_starts_with($connection, 'pdo_oci://'):
7474
if (!class_exists(DriverManager::class)) {
75-
throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require doctrine/dbal".', $connection));
75+
throw new \InvalidArgumentException('Unsupported PDO OCI DSN. Try running "composer require doctrine/dbal".');
7676
}
7777
$connection[3] = '-';
7878
$params = class_exists(DsnParser::class) ? (new DsnParser())->parse($connection) : ['url' => $connection];

0 commit comments

Comments
 (0)