Skip to content

Commit 473e91e

Browse files
committed
- MySQLExceptionInterpreter::throwMoreConcreteException now handles SQL-Error-Codes 1022, 1169, 1586
1 parent 9ed34e0 commit 473e91e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Databases/MySQL/MySQLExceptionInterpreter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ public function throwMoreConcreteException(PDOException $exception) {
2020
case 2006: throw new DatabaseHasGoneAwayException($message, $code, $exception);
2121
case 1213: throw new SqlDeadLockException($message, $code, $exception);
2222
case 1205: throw new LockWaitTimeoutExceededException($message, $code, $exception);
23-
case 1062: throw new DuplicateUniqueKeyException($message, $code, $exception);
23+
case 1022:
24+
case 1062:
25+
case 1169:
26+
case 1586: throw new DuplicateUniqueKeyException($message, $code, $exception);
2427
}
2528
/** @link http://php.net/manual/en/class.exception.php#Hcom115813 (cHao's comment) */
2629
if(!is_string($message) || !is_int($code)) {

0 commit comments

Comments
 (0)