Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
05f1cfa3
Commit
05f1cfa3
authored
Aug 27, 2013
by
dazz
Committed by
Benjamin Eberlei
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-407] Be more specific on error code condition while detecting
parent
18c3c175
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Driver.php
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
+3
-2
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
+3
-1
No files found.
lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
View file @
05f1cfa3
...
...
@@ -120,8 +120,9 @@ class Driver implements \Doctrine\DBAL\Driver
if
(
strpos
(
$exception
->
getMessage
(),
'Cannot delete or update a parent row: a foreign key constraint fails'
)
!==
false
)
{
return
DBALException
::
ERROR_FOREIGN_KEY_CONSTRAINT
;
}
return
DBALException
::
ERROR_DUPLICATE_KEY
;
if
(
strpos
(
$exception
->
getMessage
(),
'Duplicate entry'
)
!==
false
)
{
return
DBALException
::
ERROR_DUPLICATE_KEY
;
}
case
'42S02'
:
return
DBALException
::
ERROR_UNKNOWN_TABLE
;
case
'42S01'
:
...
...
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
View file @
05f1cfa3
...
...
@@ -121,7 +121,9 @@ class Driver implements \Doctrine\DBAL\Driver
{
switch
(
$exception
->
getCode
())
{
case
23000
:
return
DBALException
::
ERROR_DUPLICATE_KEY
;
if
(
strpos
(
$exception
->
getMessage
(),
'must be unique'
)
!==
false
)
{
return
DBALException
::
ERROR_DUPLICATE_KEY
;
}
case
'HY000'
:
if
(
strpos
(
$exception
->
getMessage
(),
'no such table:'
)
!==
false
)
{
return
DBALException
::
ERROR_UNKNOWN_TABLE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment