From 5b2fdf7e5b37ab2e4eff91b49199e8d41765f87e Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 1 Dec 2025 11:19:25 +0200 Subject: [PATCH] tmp debug health db api --- app/controllers/api/health.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 765688e1ee..68324aeb96 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -124,13 +124,25 @@ 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) { + } catch (\Throwable $e) { $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)); }