Use the repsonse,.ok rather than manual status code check

This commit is contained in:
David Baker 2023-07-03 17:07:00 +01:00
parent f64bd0ab25
commit edcf9f3fd5

View file

@ -47,7 +47,7 @@ export async function getSFUConfigWithOpenID(
device_id: client.getDeviceId(),
}),
});
if (res.status / 100 !== 2) {
if (!res.ok) {
throw new Error("SFO Config fetch failed with status code " + res.status);
}
const sfuConfig = await res.json();