Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

explicitly display mysqli error #269

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Adapter/Driver/Mysqli/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ public function prepare($sql = null)
$this->resource = $this->mysqli->prepare($sql);
if (!$this->resource instanceof \mysqli_stmt) {
throw new Exception\InvalidQueryException(
'Statement couldn\'t be produced with sql: ' . $sql,
sprintf(
' Error #%d: %s. Statement couldn\'t be produced with sql: %s',
$this->mysqli->errno, $this->mysqli->error, $sql
),
null,
new Exception\ErrorException($this->mysqli->error, $this->mysqli->errno)
);
Expand Down