Commit 28424002 authored by Marco Pivetta's avatar Marco Pivetta

Merge branch 'hotfix/#771-backport-php-5-4-unique-index-exception-error-handling' into 2.5

parents 4067c725 8bfcf683
......@@ -42,6 +42,7 @@ abstract class AbstractSQLiteDriver implements Driver, ExceptionConverterDriver
{
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);
......
......@@ -71,6 +71,7 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest
self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => array(
array(null, null, 'must be unique'),
array(null, null, 'is not unique'),
array(null, null, 'are not unique'),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment