Skip to content

Commit

Permalink
Merge branch 'hotfix/#771-backport-php-5-4-unique-index-exception-err…
Browse files Browse the repository at this point in the history
…or-handling' into 2.5
  • Loading branch information
Ocramius committed Jan 11, 2015
2 parents 4067c72 + 8bfcf68 commit 2842400
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function convertException($message, DriverException $exception)
{
if (strpos($exception->getMessage(), 'must be unique') !== false ||
strpos($exception->getMessage(), 'is not unique') !== false ||
strpos($exception->getMessage(), 'are not unique') !== false ||
strpos($exception->getMessage(), 'UNIQUE constraint failed') !== false
) {
return new Exception\UniqueConstraintViolationException($message, $exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ protected function getExceptionConversionData()
self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => array(
array(null, null, 'must be unique'),
array(null, null, 'is not unique'),
array(null, null, 'are not unique'),
),
);
}
Expand Down

0 comments on commit 2842400

Please sign in to comment.