From 67c3fad8212bca49a8f98dacd74be2f12b36464d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 00:25:09 +0000 Subject: [PATCH] Add error handling to emotes fetch call Agent-Logs-Url: https://github.com/Open3DLab/mikebase/sessions/349bd27e-61d5-40d4-b4d1-0c552a78a9e2 Co-authored-by: Ganonmaster <168445+Ganonmaster@users.noreply.github.com> --- src/templates/index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/templates/index.html b/src/templates/index.html index 6b8a818..72abe77 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -57,7 +57,10 @@ } fetch('/json') - .then(function(r){ return r.json(); }) + .then(function(r){ + if (!r.ok) throw new Error('HTTP ' + r.status); + return r.json(); + }) .then(function(data){ var grid = document.getElementById('grid'); var emotes = data.emotes || []; @@ -83,6 +86,11 @@ card.appendChild(span); grid.appendChild(card); }); + }) + .catch(function(err){ + var grid = document.getElementById('grid'); + grid.textContent = 'Failed to load emotes: ' + err.message; + grid.style.color = '#f66'; }); })();