Fix error message for failed search requests
This commit is contained in:
parent
85470a277e
commit
b7489c562b
1 changed files with 1 additions and 1 deletions
|
@ -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'));
|
||||||
|
|
Reference in a new issue