Skip to content

Commit 45aec5e

Browse files
committed
Maybe the stack was too long and got cropped
1 parent 1142871 commit 45aec5e

File tree

1 file changed

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

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import com.codename1.testing.AbstractTest;
1212
import com.codename1.util.StringUtil;
1313

14+
import java.util.List;
15+
1416
public final class Cn1ssDeviceRunner extends DeviceRunner {
1517
private static final BaseTest[] TEST_CLASSES = new BaseTest[] {
1618
new MainScreenScreenshotTest(),
@@ -26,9 +28,14 @@ public void runSuite() {
2628
CN.callSerially(() -> {
2729
Display.getInstance().addEdtErrorHandler(e -> {
2830
log("CN1SS:ERR:exception caught in EDT " + e.getSource());
29-
String stack = "CN1SS:ERR:exception stack: " + Display.getInstance().getStackTrace(Thread.currentThread(), (Throwable)e.getSource());
30-
stack = StringUtil.replaceAll(stack,"\n", "\nCN1SS:ERR:exception stack: ");
31-
log(stack);
31+
String stack = Display.getInstance().getStackTrace(Thread.currentThread(), (Throwable)e.getSource());
32+
log("CN1SS:ERR:exception stack of length: " + stack.length());
33+
for(String s : StringUtil.tokenize(stack, '\n')) {
34+
if(s.length() > 200) {
35+
s = s.substring(0, 200);
36+
}
37+
log("CN1SS:ERR:Stack:" + s);
38+
}
3239
});
3340
});
3441
for (BaseTest testClass : TEST_CLASSES) {

0 commit comments

Comments
 (0)