Skip to content

Commit 6509bb9

Browse files
committed
Trying to add stack traces to logging
1 parent 875e608 commit 6509bb9

File tree

1 file changed

+5
-0
lines changed
  • scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests

1 file changed

+5
-0
lines changed

scripts/hellocodenameone/common/src/main/java/com/codenameone/examples/hellocodenameone/tests/Cn1ssDeviceRunner.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.codenameone.examples.hellocodenameone.tests;
22

3+
import com.codename1.impl.CodenameOneThread;
34
import com.codename1.io.Log;
45
import com.codename1.io.Util;
56
import com.codename1.testing.DeviceRunner;
@@ -24,6 +25,10 @@ public void runSuite() {
2425
CN.callSerially(() -> {
2526
Display.getInstance().addEdtErrorHandler(e -> {
2627
log("CN1SS:ERR:exception caught in EDT " + e.getSource());
28+
Thread thr = Thread.currentThread();
29+
if(thr instanceof CodenameOneThread && ((CodenameOneThread)thr).hasStackFrame()) {
30+
log("CN1SS:ERR:exception stack: " + ((CodenameOneThread)thr).getStack((Throwable) e.getSource()));
31+
}
2732
Log.e((Throwable)e.getSource());
2833
});
2934
});

0 commit comments

Comments
 (0)