Skip to content

Commit

Permalink
fix. PDOException的code可能为字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
anhoder committed Dec 16, 2020
1 parent 9a0146b commit 2e82980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db/src/Connection/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ protected function runQueryCallback(string $query, array $bindings, Closure $cal
$this->releaseOrRemove();

// Throw exception
throw new DbException($e->getMessage(), $e->getCode(), $e);
throw new DbException($e->getMessage(), (int)$e->getCode(), $e);
}

// If an exception occurs when attempting to run a query, we'll format the error
Expand All @@ -698,7 +698,7 @@ protected function runQueryCallback(string $query, array $bindings, Closure $cal
CLog::error('Fail err=<error>%s</error> sql=%s', $e->getMessage(), $rawSql);

// Throw exception
throw new DbException($e->getMessage(), $e->getCode(), $e);
throw new DbException($e->getMessage(), (int)$e->getCode(), $e);
}

$this->pdoType = self::TYPE_DEFAULT;
Expand Down

0 comments on commit 2e82980

Please sign in to comment.