[object Object]

← back to Commercialrealestate

mls.html: split load-vs-render catch so errors stop mislabeling (DTD 5/5+contrarian)

7412b4598149d99e2acac0243946ce15af3e63c5 · 2026-08-18 12:24:15 -0700 · Steve

The single outer .catch relabeled any render/parse TypeError as 'failed to load
/data/ranked.json' — exactly what masked the credentialed-baseURI bug. Wrap the
render tail (autoCols/buildRail/render) in its own try/catch with an accurate
'loaded but failed to render' message; add console.error(real stack) to both the
render and load paths. ~6 lines, mls.html only — not the 22-page refactor.

Files touched

Diff

commit 7412b4598149d99e2acac0243946ce15af3e63c5
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Aug 18 12:24:15 2026 -0700

    mls.html: split load-vs-render catch so errors stop mislabeling (DTD 5/5+contrarian)
    
    The single outer .catch relabeled any render/parse TypeError as 'failed to load
    /data/ranked.json' — exactly what masked the credentialed-baseURI bug. Wrap the
    render tail (autoCols/buildRail/render) in its own try/catch with an accurate
    'loaded but failed to render' message; add console.error(real stack) to both the
    render and load paths. ~6 lines, mls.html only — not the 22-page refactor.
---
 public/mls.html | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/public/mls.html b/public/mls.html
index 4f45dee..8eb4ed7 100644
--- a/public/mls.html
+++ b/public/mls.html
@@ -872,8 +872,14 @@ fetch('/data/ranked.json').then(r=>r.json()).then(async d=>{ DATA=(d.ranked||d)|
     });
   }catch(e){}
   DATA.forEach(r=>{ r._hay=buildHay(r); });   // (re)build the cached search haystack now that every enrichment field is attached
-  autoCols(); buildRail(); render(); })
-  .catch(()=>{ $('#count').textContent='failed to load /data/ranked.json'; });
+  // Separate the RENDER failure mode from the LOAD failure mode (DTD 5/5 + contrarian, 2026-08-18).
+  // Previously one outer .catch relabeled ANY error here — a render/parse TypeError included — as
+  // "failed to load /data/ranked.json", which masked a real render-time bug during debugging. The
+  // data is already in hand at this point, so a throw from autoCols/buildRail/render is a RENDER
+  // fault, not a load fault; report it as such and log the real stack.
+  try { autoCols(); buildRail(); render(); }
+  catch(e){ console.error('CRCP: data loaded but render failed —', e); $('#count').textContent='data loaded but failed to render — see console'; } })
+  .catch(e=>{ console.error('CRCP: /data/ranked.json load/parse failed —', e); $('#count').textContent='failed to load /data/ranked.json'; });
 
 // $0 on-demand: click "🔎 agent" → discover that one agent's own site+phone (local, free).
 document.addEventListener('click', async e=>{

← d6f3dbf Apply credential-safe fetch wrapper fleet-wide (22 CRCP page  ·  back to Commercialrealestate  ·  auto-data-snapshot: 2026-08-18T12:24:13 (1 data files) — dat 687eef0 →