Skip to content

Commit

Permalink
use Error as the default error name
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Feb 13, 2020
1 parent 56a20db commit 5b3483a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/public/http/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class Fetch {
try {
response = await window.fetch(request);
} catch (err) {
throw new HttpFetchError(err.message, err.name ?? 'FetchError', request);
throw new HttpFetchError(err.message, err.name ?? 'Error', request);
}

const contentType = response.headers.get('Content-Type') || '';
Expand All @@ -166,11 +166,11 @@ export class Fetch {
}
}
} catch (err) {
throw new HttpFetchError(err.message, err.name ?? 'FetchError', request, response, body);
throw new HttpFetchError(err.message, err.name ?? 'Error', request, response, body);
}

if (!response.ok) {
throw new HttpFetchError(response.statusText, 'FetchError', request, response, body);
throw new HttpFetchError(response.statusText, 'Error', request, response, body);
}

return { fetchOptions, request, response, body };
Expand Down

0 comments on commit 5b3483a

Please sign in to comment.