|
11 | 11 | import io.sentry.protocol.SentryTransaction; |
12 | 12 | import io.sentry.transport.ITransport; |
13 | 13 | import io.sentry.transport.RateLimiter; |
14 | | -import io.sentry.util.CheckInUtils; |
15 | | -import io.sentry.util.HintUtils; |
16 | | -import io.sentry.util.Objects; |
17 | | -import io.sentry.util.Random; |
18 | | -import io.sentry.util.SentryRandom; |
19 | | -import io.sentry.util.TracingUtils; |
| 14 | +import io.sentry.util.*; |
20 | 15 | import java.io.Closeable; |
21 | 16 | import java.io.IOException; |
22 | 17 | import java.util.ArrayList; |
@@ -103,42 +98,21 @@ private boolean shouldApplyScopeData(final @NotNull CheckIn event, final @NotNul |
103 | 98 |
|
104 | 99 | if (event != null) { |
105 | 100 | final Throwable eventThrowable = event.getThrowable(); |
106 | | - if (eventThrowable != null) { |
107 | | - if (options.containsIgnoredExceptionForType(eventThrowable)) { |
108 | | - options |
109 | | - .getLogger() |
110 | | - .log( |
111 | | - SentryLevel.DEBUG, |
112 | | - "Event was dropped as the exception %s is ignored", |
113 | | - eventThrowable.getClass()); |
114 | | - options |
115 | | - .getClientReportRecorder() |
116 | | - .recordLostEvent(DiscardReason.EVENT_PROCESSOR, DataCategory.Error); |
117 | | - return SentryId.EMPTY_ID; |
118 | | - } |
119 | | - |
120 | | - final List<FilterString> ignoredExceptions = options.getIgnoredExceptions(); |
121 | | - if (ignoredExceptions != null) { |
122 | | - final String throwableClassName = eventThrowable.getClass().getCanonicalName(); |
123 | | - if (throwableClassName != null) { |
124 | | - for (final FilterString filter : ignoredExceptions) { |
125 | | - if (filter.getFilterString().equals(throwableClassName) |
126 | | - || filter.matches(throwableClassName)) { |
127 | | - options |
128 | | - .getLogger() |
129 | | - .log( |
130 | | - SentryLevel.DEBUG, |
131 | | - "Event was dropped as the exception %s matches the ignoreExceptions filter pattern %s", |
132 | | - throwableClassName, |
133 | | - filter.getFilterString()); |
134 | | - options |
135 | | - .getClientReportRecorder() |
136 | | - .recordLostEvent(DiscardReason.EVENT_PROCESSOR, DataCategory.Error); |
137 | | - return SentryId.EMPTY_ID; |
138 | | - } |
139 | | - } |
140 | | - } |
141 | | - } |
| 101 | + if (eventThrowable != null |
| 102 | + && ExceptionUtils.isIgnored( |
| 103 | + options.getIgnoredExceptionsForType(), |
| 104 | + options.getIgnoredExceptions(), |
| 105 | + eventThrowable)) { |
| 106 | + options |
| 107 | + .getLogger() |
| 108 | + .log( |
| 109 | + SentryLevel.DEBUG, |
| 110 | + "Event was dropped as the exception %s is ignored", |
| 111 | + eventThrowable.getClass()); |
| 112 | + options |
| 113 | + .getClientReportRecorder() |
| 114 | + .recordLostEvent(DiscardReason.EVENT_PROCESSOR, DataCategory.Error); |
| 115 | + return SentryId.EMPTY_ID; |
142 | 116 | } |
143 | 117 | } |
144 | 118 |
|
|
0 commit comments