Skip to content

Commit

Permalink
Update Statement.php
Browse files Browse the repository at this point in the history
catch error when query fails
  • Loading branch information
christopheg authored Mar 28, 2022
1 parent e99e810 commit 5128fca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Skeleton/Database/Driver/Mysqli/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ public function fetch_assoc() {
* @access public
*/
public function execute() {
parent::execute();
try {
parent::execute();
} catch (\Exception $e) {
throw new \Skeleton\Database\Exception\Connection($this->sqlstate . ': ' . $this->error);
}
if ($this->errno > 0){
throw new \Skeleton\Database\Exception\Query($this->error);
}
Expand Down

0 comments on commit 5128fca

Please sign in to comment.