Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ boolean hasExceptionStateTracked() {
}

public static class ThrowableState {
private static final int MAX_SNAPSHOTS = 256;

private final String exceptionId;
private final List<Snapshot> snapshots = new ArrayList<>();
private boolean snapshotSent;
Expand All @@ -202,8 +204,11 @@ public List<Snapshot> getSnapshots() {
}

public void addSnapshot(Snapshot snapshot) {
if (snapshots.size() > 256) {
LOGGER.debug("Too many (256) snapshots for exceptionId={}, dropping snapshot", exceptionId);
if (snapshots.size() > MAX_SNAPSHOTS) {
LOGGER.debug(
"Too many ({}) snapshots for exceptionId={}, dropping snapshot",
MAX_SNAPSHOTS,
exceptionId);
return;
}
snapshots.add(snapshot);
Expand Down