diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 68324aeb96..d573d230b8 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -124,26 +124,16 @@ App::get('/v1/health/db') ]); } else { $failures[] = $database; - // Add failure to output instead of throwing - $output[] = new Document([ - 'name' => $key . " ($database)", - 'status' => 'fail', - 'ping' => 0 - ]); } - } catch (\Throwable $e) { + } catch (\Throwable) { + var_dump($key . " ($database)",); $failures[] = $database; - // Add failure to output instead of throwing - $output[] = new Document([ - 'name' => $key . " ($database)", - 'status' => 'fail', - 'ping' => 0 - ]); } } } - + if (!empty($failures)) { + throw new Exception(Exception::GENERAL_SERVER_ERROR, 'DB failure on: ' . implode(", ", $failures)); }