mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
extract first our stack frame to get more meaningful reports of SWT errors
This commit is contained in:
parent
3d17efa2fa
commit
6ed7d88252
@ -53,8 +53,13 @@ public class GoogleAnalytics {
|
||||
|
||||
static String extractFirstStackFrame(Throwable e) {
|
||||
StackTraceElement[] stackTrace = e.getStackTrace();
|
||||
return e.toString() + (stackTrace.length == 0 ? "" : "\n" +
|
||||
stackTrace[0].getClassName() + "." + stackTrace[0].getMethodName() + ":" + stackTrace[0].getLineNumber());
|
||||
StackTraceElement element = null;
|
||||
for (int i = 0; i < stackTrace.length; i++) {
|
||||
element = stackTrace[i];
|
||||
if (element.getClassName().startsWith("net.azib.ipscan")) break;
|
||||
}
|
||||
return e.toString() + (element == null ? "" : "\n" +
|
||||
element.getClassName() + "." + element.getMethodName() + ":" + element.getLineNumber());
|
||||
}
|
||||
|
||||
public void asyncReport(final String screen) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user