Fix: better response processing.

This commit is contained in:
John Livingston 2021-04-10 13:57:15 +02:00
parent f65b6ae876
commit 80a51df1d5

View File

@ -97,14 +97,14 @@ function launchTests (): void {
test: test
})
})
const data = await response.json()
if (!response.ok) {
return {
test: test,
messages: ['Unknown error'],
messages: [response.statusText ?? 'Unknown error'],
ok: false
}
}
const data = await response.json()
if ((typeof data) !== 'object') {
return {
test: test,