Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4fe3957

Browse files
committed
[v7] Remove unnecessary async/await from transport-fetch
1 parent 10048e4 commit 4fe3957

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/transport-fetch/src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ export class FetchTransport extends BaseTransport implements Transport {
1515
requestOptions.credentials = this._options.credentials as RequestCredentials;
1616
}
1717

18-
return fetch(this._dsn.getEnvelopeEndpoint(), requestOptions).then(async response => {
19-
return {
20-
body: await response.text(),
18+
return fetch(this._dsn.getEnvelopeEndpoint(), requestOptions).then(response => {
19+
return response.text().then(body => ({
20+
body,
2121
headers: {
2222
'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
2323
'retry-after': response.headers.get('Retry-After'),
2424
},
2525
reason: response.statusText,
2626
statusCode: response.status,
27-
};
27+
}));
2828
});
2929
}
3030
}

0 commit comments

Comments
 (0)