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
No known key found for this signature in database

View file

@ -35,7 +35,7 @@
// make request // make request
const response = await fetch("/search/" + query); const response = await fetch("/search/" + query);
if (!response.ok) { 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(); let result = await response.text();
updateSearchResults(result.split('\n')); updateSearchResults(result.split('\n'));