fix(jslib): 🧑‍💻 better error messages for api/query

feat/lang-upgrades-keys
Tomáš Mládek 2023-10-09 22:13:11 +02:00
parent 0ed585aa32
commit bf223cf247
1 changed files with 7 additions and 0 deletions

View File

@ -73,6 +73,13 @@ export class UpEndApi {
keepalive: true,
})
.then(async (response) => {
if (!response.ok) {
reject(
`Query ${queryStr} failed: ${response.status} ${
response.statusText
}: ${await response.text()}}`
);
}
resolve(new UpListing(await response.json()));
this.inFlightRequests[queryStr] = null;
})