Skip to content

Commit 918237e

Browse files
committed
add catch error messages
1 parent d9b8388 commit 918237e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/browser/src/profiling/lifecycleMode/traceLifecycleProfiler.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ export class BrowserTraceLifecycleProfiler {
125125
`[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,
126126
);
127127
if (rootSpanCount === 0) {
128-
this._collectCurrentChunk().catch(() => /* no catch */ {});
128+
this._collectCurrentChunk().catch(e => {
129+
DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `spanEnd`:', e);
130+
});
129131

130132
this.stop();
131133
}
@@ -196,7 +198,9 @@ export class BrowserTraceLifecycleProfiler {
196198
this._clearAllRootSpanTimeouts();
197199

198200
// Collect whatever was currently recording
199-
this._collectCurrentChunk().catch(() => /* no catch */ {});
201+
this._collectCurrentChunk().catch(e => {
202+
DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `stop()`:', e);
203+
});
200204
}
201205

202206
/**
@@ -241,7 +245,9 @@ export class BrowserTraceLifecycleProfiler {
241245
}
242246

243247
this._chunkTimer = setTimeout(() => {
244-
this._collectCurrentChunk().catch(() => /* no catch */ {});
248+
this._collectCurrentChunk().catch(e => {
249+
DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk during periodic chunking:', e);
250+
});
245251

246252
if (this._isRunning) {
247253
this._startProfilerInstance();

0 commit comments

Comments
 (0)