Skip to content

Commit 28b0a1e

Browse files
committed
fix(API): return 500 instead of 200 on diagnostics endpoint failure
getDiagnosticsResponse handles all subsystem failures internally via settle(), so an exception reaching the outer catch is a genuine bug that should be surfaced to monitoring tools as a 500.
1 parent e34f409 commit 28b0a1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ app.get('/diagnostics', async (req, res) => {
542542
return res.status(200).json(result);
543543
} catch (error) {
544544
logger.error(`[diagnostics]: unexpected error building response: ${error.message}`);
545-
return res.status(200).json({
545+
return res.status(500).json({
546546
timestamp: new Date().toISOString(),
547547
error: `Failed to build diagnostics response: ${error.message}`,
548548
});

0 commit comments

Comments
 (0)