Skip to content

Commit 0b1ea35

Browse files
committed
catch exceptions in startProfiler/stopProfiler
1 parent eb6a942 commit 0b1ea35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sentry-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ public void startProfiler(
158158
logger.log(SentryLevel.DEBUG, "Started Profiler.");
159159
start();
160160
}
161+
} catch (Exception e) {
162+
logger.log(SentryLevel.ERROR, "Error starting profiler: ", e);
161163
}
162164
}
163165

@@ -326,6 +328,8 @@ private void stop(final boolean restartProfiler) {
326328
profilerId = SentryId.EMPTY_ID;
327329
logger.log(SentryLevel.DEBUG, "Profile chunk finished.");
328330
}
331+
} catch (Exception e) {
332+
logger.log(SentryLevel.ERROR, "Error stopping profiler: ", e);
329333
}
330334
}
331335

0 commit comments

Comments
 (0)