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