Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public shouldDropEvent(currentEvent: SentryEvent, previousEvent?: SentryEvent): boolean {
if (!previousEvent) {
return false;
}
if (this.isSameMessageEvent(currentEvent, previousEvent)) {
logger.warn(
`Event dropped due to being a duplicate of previous event (same message).\nEvent: ${getEventDescription(
currentEvent,
)}`,
);
return true;
}
if (this.isSameExceptionEvent(currentEvent, previousEvent)) {
logger.warn(
`Event dropped due to being a duplicate of previous event (same exception).\nEvent: ${getEventDescription(
currentEvent,
)}`,
);
return true;
}
return false;
}
public shouldDropEvent(currentEvent: SentryEvent, previousEvent?: SentryEvent): boolean {
if (!previousEvent) {
return false;
}
if (this.isSameMessageEvent(currentEvent, previousEvent)) {
logger.warn(
`Event dropped due to being a duplicate of previous event (same message).\nEvent: ${getEventDescription(
currentEvent,
)}`,
);
return true;
}
if (this.isSameExceptionEvent(currentEvent, previousEvent)) {
logger.warn(
`Event dropped due to being a duplicate of previous event (same exception).\nEvent: ${getEventDescription(
currentEvent,
)}`,
);
return true;
}