From 7012c34fd7ef0794c73d02f6486ffc23f47c4e3f Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Tue, 23 Jun 2020 21:48:33 -0400 Subject: [PATCH] Fixed database error handling for #286 --- api/cora/database.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/cora/database.php b/api/cora/database.php index 9dcec1a..6891ad5 100644 --- a/api/cora/database.php +++ b/api/cora/database.php @@ -374,13 +374,15 @@ final class database extends \mysqli { ]; if($result === false) { + $error = $this->error; $this->rollback_transaction(); + throw new exception( 'Database query failed.', 1206, true, [ - 'database_error' => $this->error, + 'database_error' => $error, 'query' => $query ] );