summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-10-18 00:08:23 +0200
committerpolo <ordipolo@gmx.fr>2026-10-18 00:10:03 +0200
commit05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch)
treecf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php
parent32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff)
downloadAppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php')
-rw-r--r--vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php49
1 files changed, 0 insertions, 49 deletions
diff --git a/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php b/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php
deleted file mode 100644
index 561e58b..0000000
--- a/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php
+++ /dev/null
@@ -1,49 +0,0 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\DBAL\Driver\API\SQLSrv;
6
7use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
8use Doctrine\DBAL\Driver\Exception;
9use Doctrine\DBAL\Exception\ConnectionException;
10use Doctrine\DBAL\Exception\DatabaseObjectNotFoundException;
11use Doctrine\DBAL\Exception\DriverException;
12use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
13use Doctrine\DBAL\Exception\InvalidFieldNameException;
14use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
15use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
16use Doctrine\DBAL\Exception\SyntaxErrorException;
17use Doctrine\DBAL\Exception\TableExistsException;
18use Doctrine\DBAL\Exception\TableNotFoundException;
19use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
20use Doctrine\DBAL\Query;
21
22/**
23 * @internal
24 *
25 * @link https://docs.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors
26 */
27final class ExceptionConverter implements ExceptionConverterInterface
28{
29 public function convert(Exception $exception, ?Query $query): DriverException
30 {
31 return match ($exception->getCode()) {
32 102 => new SyntaxErrorException($exception, $query),
33 207 => new InvalidFieldNameException($exception, $query),
34 208 => new TableNotFoundException($exception, $query),
35 209 => new NonUniqueFieldNameException($exception, $query),
36 515 => new NotNullConstraintViolationException($exception, $query),
37 547,
38 4712 => new ForeignKeyConstraintViolationException($exception, $query),
39 2601,
40 2627 => new UniqueConstraintViolationException($exception, $query),
41 2714 => new TableExistsException($exception, $query),
42 3701,
43 15151 => new DatabaseObjectNotFoundException($exception, $query),
44 11001,
45 18456 => new ConnectionException($exception, $query),
46 default => new DriverException($exception, $query),
47 };
48 }
49}