Skip to content

Commit 851037f

Browse files
JonasBaAbhiPrasad
andauthored
fix(profiling): catch sendProfile rejection (#7446)
Co-authored-by: Abhijeet Prasad <[email protected]>
1 parent 80b6939 commit 851037f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/browser/src/profiling/sendProfile.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,8 @@ export function sendProfile(profileId: string, profile: ProcessedJSSelfProfile):
8282
logger.log('[Profiling] Envelope constructed, sending it');
8383
}
8484

85-
void transport.send(envelope);
85+
// Wrap in try/catch because send will throw in case of a network error.
86+
transport.send(envelope).then(null, reason => {
87+
__DEBUG_BUILD__ && logger.log('[Profiling] Error while sending event:', reason);
88+
});
8689
}

0 commit comments

Comments
 (0)