Skip to content

Commit 84f28fa

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

File tree

1 file changed

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

1 file changed

+9
-3
lines changed

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

Lines changed: 9 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,13 @@ 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+
for(String s : StringUtil.tokenize(stack, '\n')) {
33+
if(s.length() > 200) {
34+
s = s.substring(0, 200);
35+
}
36+
log("CN1SS:ERR:Stack:" + s);
37+
}
3238
});
3339
});
3440
for (BaseTest testClass : TEST_CLASSES) {

0 commit comments

Comments
 (0)