MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / makeRequest

Function makeRequest

packages/bun/src/transports/index.ts:8–30  ·  view source on GitHub ↗
(request: TransportRequest)

Source from the content-addressed store, hash-verified

6 */
7export function makeFetchTransport(options: BaseTransportOptions): Transport {
8 function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {
9 const requestOptions: RequestInit = {
10 body: request.body,
11 method: 'POST',
12 headers: options.headers,
13 };
14
15 try {
16 return suppressTracing(() => {
17 return fetch(options.url, requestOptions).then(response => {
18 return {
19 statusCode: response.status,
20 headers: {
21 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
22 'retry-after': response.headers.get('Retry-After'),
23 },
24 };
25 });
26 });
27 } catch (e) {
28 return Promise.reject(e);
29 }
30 }
31
32 return createTransport(options, makeRequest);
33}

Callers

nothing calls this directly

Calls 5

suppressTracingFunction · 0.90
rejectMethod · 0.80
getMethod · 0.65
fetchFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected