Skip to content

Commit 8c43868

Browse files
committed
refactor: use return empty string on pg_last_error() got empty "0"
1 parent fe32cbb commit 8c43868

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/Database/Postgre/Connection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,11 @@ protected function _enableForeignKeyChecks()
461461
*/
462462
public function error(): array
463463
{
464+
$lastError = pg_last_error($this->connID);
465+
464466
return [
465467
'code' => '',
466-
'message' => pg_last_error($this->connID),
468+
'message' => ! in_array($lastError, ['', '0'], true) ? $lastError : '',
467469
];
468470
}
469471

0 commit comments

Comments
 (0)