Skip to content

Commit

Permalink
add trigger error on query error
Browse files Browse the repository at this point in the history
  • Loading branch information
sveneld committed Mar 2, 2024
1 parent eb7b8d4 commit 0167b44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Db/MysqliDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function connect()
!empty($this->conn->connect_errno) ? $this->conn->connect_errno : 0
);
} else {
trigger_error('DB connection error!', E_USER_ERROR);
die(_('DB connection error!'));
}
}
Expand All @@ -63,6 +64,7 @@ public function query($query, $params = array())
if ($this->throwException) {
throw new \RuntimeException('DB error in : ' . $query);
} else {
trigger_error('DB error in : ' . $query, E_USER_ERROR);
die(_('DB error') . ' ' . $this->conn->error . ' ' . _('in') . ': ' . $query);
}
}
Expand Down

0 comments on commit 0167b44

Please sign in to comment.