[object Object]

← back to Loops Dashboard

morning-review: surface HTTP status on non-200 instead of misleading parse-fail

c22ac93fef23e6f129f9e0fbce2722a08a68e880 · 2026-05-18 17:33:35 -0700 · Steve

Files touched

Diff

commit c22ac93fef23e6f129f9e0fbce2722a08a68e880
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon May 18 17:33:35 2026 -0700

    morning-review: surface HTTP status on non-200 instead of misleading parse-fail
---
 server.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server.js b/server.js
index aa9cd89..78a65e1 100644
--- a/server.js
+++ b/server.js
@@ -122,6 +122,9 @@ function getMorningReviewState() {
       let body = '';
       res.on('data', c => body += c);
       res.on('end', () => {
+        if (res.statusCode !== 200) {
+          return resolve({ total: 0, by_source: {}, error: 'http-' + res.statusCode });
+        }
         try {
           const d = JSON.parse(body);
           const findings = d.findings || (Array.isArray(d) ? d : []);

← f3c1c8b gitignore: add tmp/ dist/ build/ .next/ per standing rule  ·  back to Loops Dashboard  ·  (newest)