diff --git a/src/lib/requests.ts b/src/lib/requests.ts index a1ed032549659b83c0d52ddb367c43550059c222..cfb3c8b3c8b053aacd6a7114d253684287e93696 100644 --- a/src/lib/requests.ts +++ b/src/lib/requests.ts @@ -2,9 +2,9 @@ export function defaultFetch(url: string, options = {}) { return fetch(url, options).then(r => { if (!r.ok) { const error = new Error( - `An error ${r.status} occurred while fetching data` + `An error ${r.status} occurred while fetching data`, + { cause: r.statusText } ); - error.cause = r.statusText; throw error; } return r.json();