MCPcopy Create free account
hub / github.com/getsentry/sentry-react-native / sendEvent

Function sendEvent

packages/core/src/js/tools/easBuildHooks.ts:140–156  ·  view source on GitHub ↗
(event: SentryEvent, dsn: DsnComponents)

Source from the content-addressed store, hash-verified

138}
139
140async function sendEvent(event: SentryEvent, dsn: DsnComponents): Promise<boolean> {
141 const endpoint = getEnvelopeEndpoint(dsn);
142 const envelope = createEnvelope(event, dsn);
143 try {
144 const response = await fetch(endpoint, {
145 method: 'POST',
146 headers: { 'Content-Type': 'application/x-sentry-envelope' },
147 body: envelope,
148 });
149 if (response.status >= 200 && response.status < 300) return true;
150 console.warn(`[Sentry] Failed to send event: HTTP ${response.status}`);
151 return false;
152 } catch (error) {
153 console.error('[Sentry] Failed to send event:', error);
154 return false;
155 }
156}
157
158function getReleaseFromEASEnv(env: EASBuildEnv): string | undefined {
159 // Honour explicit override first

Callers 2

captureEASBuildErrorFunction · 0.85
captureEASBuildSuccessFunction · 0.85

Calls 2

getEnvelopeEndpointFunction · 0.85
createEnvelopeFunction · 0.85

Tested by

no test coverage detected