diff --git a/packages/connect/src/utils/assets.native.ts b/packages/connect/src/utils/assets.native.ts index bb786314fb3..112c1c43a5b 100644 --- a/packages/connect/src/utils/assets.native.ts +++ b/packages/connect/src/utils/assets.native.ts @@ -13,6 +13,12 @@ export function httpRequest( ...options, }) .then(response => { + if (!response.ok) { + console.error('HTTP request failed', response); + throw new Error( + `HTTP request failed with status ${response.status} ${response.statusText}`, + ); + } if (type === 'binary') { return response.arrayBuffer() as unknown as HttpRequestReturnType; } @@ -23,7 +29,7 @@ export function httpRequest( return response.text() as unknown as HttpRequestReturnType; }) .catch(error => { - console.error('httpRequest native error', error); + console.error('HTTP request failed', error); throw error; }); }