mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-08 10:15:21 -05:00
Change the error filter
Former-commit-id: 822a92a80076aa1cc33cd00a94910fd13f4cf84c [formerly fddeae667697c5a2f4ad4161c016814ebd5d0d63] Former-commit-id: ca0acef044ce122f2fe4658e118b9ea7a427402c
This commit is contained in:
1 parent
489823947c
commit
087c26dfed
1 file changed
+14
-1
@@ -174,7 +174,15 @@ public class SentryErrorReporter {
|
||||
if (!enabled) {
|
||||
return false;
|
||||
}
|
||||
String text = throwable.getMessage() + "%" + throwable.getStackTrace()[0];
|
||||
StackTraceElement stackTraceElement;
|
||||
if (throwable.getStackTrace().length < 3) {
|
||||
stackTraceElement = throwable.getStackTrace()[1];
|
||||
} else {
|
||||
stackTraceElement = throwable.getStackTrace()[2];
|
||||
}
|
||||
|
||||
String text = stackTraceElement.getClassName() + "#" + stackTraceElement.getMethodName() + "#" + stackTraceElement
|
||||
.getLineNumber();
|
||||
if (!reported.contains(text)) {
|
||||
reported.add(text);
|
||||
return true;
|
||||
@@ -209,6 +217,11 @@ public class SentryErrorReporter {
|
||||
if (Util.isDevMode()) {
|
||||
return true;
|
||||
}
|
||||
//No, pls do not report the OutOfMemory Error, i didn't care it.
|
||||
|
||||
if (record.getThrown() instanceof OutOfMemoryError) {
|
||||
return true;
|
||||
}
|
||||
sendError(record.getThrown(), record.getMessage());
|
||||
return false; //Hide errors
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user