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 test: test
}) })
}) })
const data = await response.json()
if (!response.ok) { if (!response.ok) {
return { return {
test: test, test: test,
messages: ['Unknown error'], messages: [response.statusText ?? 'Unknown error'],
ok: false ok: false
} }
} }
const data = await response.json()
if ((typeof data) !== 'object') { if ((typeof data) !== 'object') {
return { return {
test: test, test: test,