Skip to content

Commit

Permalink
refactor: use return empty string on pg_last_error() got empty "0"
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 27, 2024
1 parent fe32cbb commit 8c43868
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,11 @@ protected function _enableForeignKeyChecks()
*/
public function error(): array
{
$lastError = pg_last_error($this->connID);

return [
'code' => '',
'message' => pg_last_error($this->connID),
'message' => ! in_array($lastError, ['', '0'], true) ? $lastError : '',
];
}

Expand Down

0 comments on commit 8c43868

Please sign in to comment.