diff --git a/src/utils/apiUtils.ts b/src/utils/apiUtils.ts index d2378b85a..dff5a30b1 100644 --- a/src/utils/apiUtils.ts +++ b/src/utils/apiUtils.ts @@ -16,6 +16,8 @@ export const getBackendUrl: (() => string) = () => { return store.getState().frontendConfig.backendUrl } -export const expectResponseCode = (response: Response, code = 200): boolean => { - return response.status !== code +export const expectResponseCode = (response: Response, code = 200): void => { + if (response.status !== code) { + throw new Error(`response code is not ${code}`) + } }