diff options
Diffstat (limited to 'vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php')
-rw-r--r-- | vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php b/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php new file mode 100644 index 0000000..cefe9a3 --- /dev/null +++ b/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php | |||
@@ -0,0 +1,26 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\DBAL\Driver\OCI8\Exception; | ||
6 | |||
7 | use Doctrine\DBAL\Driver\AbstractException; | ||
8 | |||
9 | use function assert; | ||
10 | use function oci_error; | ||
11 | |||
12 | /** | ||
13 | * @internal | ||
14 | * | ||
15 | * @psalm-immutable | ||
16 | */ | ||
17 | final class ConnectionFailed extends AbstractException | ||
18 | { | ||
19 | public static function new(): self | ||
20 | { | ||
21 | $error = oci_error(); | ||
22 | assert($error !== false); | ||
23 | |||
24 | return new self($error['message'], null, $error['code']); | ||
25 | } | ||
26 | } | ||