fix: don't omit stack trace elements without locations

This commit is contained in:
TopchetoEU 2024-12-25 02:54:22 +02:00
parent a705bf296e
commit 3a6401094f
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -21,6 +21,8 @@ public class EngineException extends RuntimeException {
return ext == null || !ext.get(Value.HIDE_STACK, false); return ext == null || !ext.get(Value.HIDE_STACK, false);
} }
public String toString() { public String toString() {
if (name == null && location == null) return "(skipped)";
var res = ""; var res = "";
var loc = location; var loc = location;
@ -49,7 +51,7 @@ public class EngineException extends RuntimeException {
public EngineException add(Environment env, String name, Location location) { public EngineException add(Environment env, String name, Location location) {
var el = new StackElement(env, location, name); var el = new StackElement(env, location, name);
if (el.name == null && el.location == null) return this; // if (el.name == null && el.location == null) return this;
setEnvironment(env); setEnvironment(env);
stackTrace.add(el); stackTrace.add(el);
return this; return this;