Skip to content

Commit 1a7dd39

Browse files
committed
Catch any exception when determining package version
1 parent 940dd3d commit 1a7dd39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
use MongoDB\Operation\DropDatabase;
3636
use MongoDB\Operation\ListDatabases;
3737
use MongoDB\Operation\Watch;
38-
use OutOfBoundsException;
38+
use Throwable;
3939
use function is_array;
4040
use function is_string;
4141

@@ -371,7 +371,7 @@ private static function getVersion() : string
371371
if (self::$version === null) {
372372
try {
373373
self::$version = PrettyVersions::getVersion('mongodb/mongodb')->getPrettyVersion();
374-
} catch (OutOfBoundsException $e) {
374+
} catch (Throwable $t) {
375375
return 'unknown';
376376
}
377377
}

0 commit comments

Comments
 (0)