feat: search one set of options
1 file changed, 4 insertions(+), 3 deletions(-)
changed files
M frontend/static/search.js → frontend/static/search.js
@@ -38,14 +38,14 @@ headers: { fetch: "true", }, }) - .then(function (res) { + .then(async function (res) { state.url = url.toJSON(); state.opened = []; - history.pushState(state, null, url); if (res.ok) { + history.pushState(state, null, url); return res.text(); } else { - throw new Error(res.statusText); + throw new Error(`${res.status} ${res.statusText}: ${await res.text()}`); } }) .then(function (html) {@@ -54,6 +54,7 @@ escapePolicy !== null ? escapePolicy.createHTML(html) : html; addToggleEventListeners(); }) .catch(function (error) { + results.innerText = error.message; console.error("fetch failed", error); }); ev.preventDefault();