diff --git a/.changeset/soft-files-obey.md b/.changeset/soft-files-obey.md index 2ad655c88..e58915b1d 100644 --- a/.changeset/soft-files-obey.md +++ b/.changeset/soft-files-obey.md @@ -1,5 +1,4 @@ --- -"@osdk/shared.net.errors": patch "@osdk/shared.net.fetch": patch --- diff --git a/packages/shared.net.fetch/src/createFetchOrThrow.ts b/packages/shared.net.fetch/src/createFetchOrThrow.ts index 34039ef8b..f76078535 100644 --- a/packages/shared.net.fetch/src/createFetchOrThrow.ts +++ b/packages/shared.net.fetch/src/createFetchOrThrow.ts @@ -46,9 +46,10 @@ export function createFetchOrThrow(fetchFn: typeof fetch = fetch) { try { body = await response.json(); } catch (e) { - throw convertError( - e, - "A network error occurred while reading response", + throw new PalantirApiError( + `Failed to fetch ${response.status} ${response.statusText}`, + "UNKNOWN", + undefined, ); }