Skip to content

Commit 5b3483a

Browse files
committed
use Error as the default error name
1 parent 56a20db commit 5b3483a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/public/http/fetch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class Fetch {
146146
try {
147147
response = await window.fetch(request);
148148
} catch (err) {
149-
throw new HttpFetchError(err.message, err.name ?? 'FetchError', request);
149+
throw new HttpFetchError(err.message, err.name ?? 'Error', request);
150150
}
151151

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

172172
if (!response.ok) {
173-
throw new HttpFetchError(response.statusText, 'FetchError', request, response, body);
173+
throw new HttpFetchError(response.statusText, 'Error', request, response, body);
174174
}
175175

176176
return { fetchOptions, request, response, body };

0 commit comments

Comments
 (0)