all repos — searchix @ c15b142b18dcdc7f5ab6d5f1afca8ae1696692cc

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: search one set of options

Alan Pearce
commit

c15b142b18dcdc7f5ab6d5f1afca8ae1696692cc

parent

6c8c36b2c34bc375859230ddc13c5071274f60b4

1 file changed, 4 insertions(+), 3 deletions(-)

changed files
M frontend/static/search.jsfrontend/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();