Skip to content

Commit 0cc5ca4

Browse files
author
Ettemlevest
authored
Adding error number to exception
Adding mysqli error number to exception in _prepareQuery method
1 parent bbd7c1d commit 0cc5ca4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MysqliDb.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,8 +1770,9 @@ protected function _prepareQuery()
17701770
{
17711771
if (!$stmt = $this->mysqli()->prepare($this->_query)) {
17721772
$msg = $this->mysqli()->error . " query: " . $this->_query;
1773+
$num = $this->mysqli()->errno;
17731774
$this->reset();
1774-
throw new Exception($msg);
1775+
throw new Exception($msg, $num);
17751776
}
17761777

17771778
if ($this->traceEnabled) {
@@ -2284,4 +2285,4 @@ private function conditionToSql($operator, $val) {
22842285
}
22852286
}
22862287

2287-
// END class
2288+
// END class

0 commit comments

Comments
 (0)