Skip to content

Commit

Permalink
Merge pull request #176 from cyklokoalicia/trigger_error_on_db_query
Browse files Browse the repository at this point in the history
add trigger error on query error
  • Loading branch information
sveneld authored Mar 2, 2024
2 parents a780048 + 0167b44 commit e1914e8
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 e1914e8

Please sign in to comment.