Skip to content

Commit 0791bdf

Browse files
committed
Adding an error code when connecting to a database
1 parent aee905c commit 0791bdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DB/DriverPDO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(?string $database = null, string $table_prefix = '')
4040
$this->preConnectionExec();
4141
} catch (\PDOException $e) {
4242
$this->debug->debug_error("[{$this->database}] Connection ERROR: [CODE: " . ($e->errorInfo[1] ?? 'NULL') . " | MESSAGE: " . ($e->errorInfo[2] ?? 'NULL') . " ]");
43-
throw new DBException('PDO Connection ERROR');
43+
throw new DBException("PDO Connection ERROR: [CODE: " . ($e->errorInfo[1] ?? 'NULL') . "]");
4444
}
4545
}
4646
private function generateDSN(): void

0 commit comments

Comments
 (0)