Skip to content

Commit a01edce

Browse files
author
rkr
committed
- PHP7-Compatibility fix
1 parent abe2206 commit a01edce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Databases/MySQL/MySQLExceptionInterpreter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class MySQLExceptionInterpreter {
1414
* @throw PDOException
1515
*/
1616
public function throwMoreConcreteException(PDOException $exception) {
17-
$code = $exception->errorInfo[1];
18-
$message = (string) $exception->errorInfo[2];
17+
$code = $exception->getCode();
18+
$message = (string) $exception->getMessage();
1919
switch($code) {
2020
case 2006: throw new DatabaseHasGoneAwayException($message, $code, $exception);
2121
case 1213: throw new SqlDeadLockException($message, $code, $exception);

0 commit comments

Comments
 (0)