From d34736d6590c07b529be2e804dd8411c68a73ee1 Mon Sep 17 00:00:00 2001 From: Thom McGrath Date: Fri, 9 Aug 2024 13:19:16 +0000 Subject: [PATCH] Fixed exception getting error code from Postgres --- Website/framework/classes/BeaconPostgreSQLDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Website/framework/classes/BeaconPostgreSQLDatabase.php b/Website/framework/classes/BeaconPostgreSQLDatabase.php index cf851e79e..b0cf90c0d 100644 --- a/Website/framework/classes/BeaconPostgreSQLDatabase.php +++ b/Website/framework/classes/BeaconPostgreSQLDatabase.php @@ -149,7 +149,7 @@ public function Query(string $sql, ...$params) { return new BeaconPostgreSQLRecordSet($result); } else { $this->ResetTransactions(); - $errorCode = pg_result_error_field($result, PGSQL_DIAG_SQLSTATE); + $errorCode = intval(pg_result_error_field($result, PGSQL_DIAG_SQLSTATE)); $errorMessage = pg_result_error_field($result, PGSQL_DIAG_MESSAGE_PRIMARY); $errorDetail = pg_result_error_field($result, PGSQL_DIAG_MESSAGE_DETAIL); if (is_null($errorDetail) === false) {