Fix error message for failed search requests

This commit is contained in:
ChaoticByte 2024-08-28 19:56:10 +02:00
parent 85470a277e
commit b7489c562b
Signed by: ChaoticByte
SSH key fingerprint: SHA256:6v88GlRHW+S4NVmM00ZxofEJlnDdK8LI1EcfR8jrgDs

View file

@ -35,7 +35,7 @@
// make request
const response = await fetch("/search/" + query);
if (!response.ok) {
throw new Error("Couldn't search, status code ", response.status);
throw new Error(`Search API returned status code ${response.status}`);
}
let result = await response.text();
updateSearchResults(result.split('\n'));