Skip to content

Commit afc61ed

Browse files
committed
Display error when database throws error.
1 parent 2b53bf7 commit afc61ed

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Handlers/DatabaseHandler.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ private function hydrate()
122122

123123
$this->table = config('Settings')->database['table'] ?? 'settings';
124124

125-
$rawValues = db_connect()->table($this->table)->get()->getResultObject();
125+
$rawValues = db_connect()->table($this->table)->get();
126+
127+
if (is_bool($rawValues))
128+
{
129+
throw new \RuntimeException(db_connect()->error()['message'] ?? 'Error reading from database.');
130+
}
131+
132+
$rawValues = $rawValues->getResultObject();
126133

127134
foreach ($rawValues as $row)
128135
{

0 commit comments

Comments
 (0)