Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Driver/API/SQLSrv/ExceptionConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\DBAL\Query;

use function str_contains;

/**
* @internal
*
Expand All @@ -40,7 +42,10 @@ public function convert(Exception $exception, ?Query $query): DriverException
2627 => new UniqueConstraintViolationException($exception, $query),
2714 => new TableExistsException($exception, $query),
3701,
15151 => new DatabaseObjectNotFoundException($exception, $query),
15151 => str_contains($exception->getMessage(), 'Cannot drop the table ')
|| str_contains($exception->getMessage(), 'Cannot alter the table ')
? new TableNotFoundException($exception, $query)
: new DatabaseObjectNotFoundException($exception, $query),
11001,
18456 => new ConnectionException($exception, $query),
default => new DriverException($exception, $query),
Expand Down
Loading