diff --git a/legend-pure-core/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/exception/PureExecutionException.java b/legend-pure-core/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/exception/PureExecutionException.java index bedf7b45a4..8f98f1deab 100644 --- a/legend-pure-core/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/exception/PureExecutionException.java +++ b/legend-pure-core/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/exception/PureExecutionException.java @@ -130,10 +130,10 @@ public T printPureStackTrace(T appendable, String indent, if ((this.callStack != null) && this.callStack.notEmpty()) { SafeAppendable safeAppendable = SafeAppendable.wrap(appendable); - safeAppendable.append('\n').append(indent).append("Full Stack:"); - this.callStack.toList().reverseForEach(x -> + safeAppendable.append('\n').append(indent).append("Full stacktrace:"); + this.callStack.toList().forEach(x -> { - safeAppendable.append('\n').append(indent).append(" "); + safeAppendable.append('\n').append(indent).append(" at "); CoreInstance func = x.getValueForMetaPropertyToOne(M3Properties.func); if (func != null) { @@ -143,7 +143,8 @@ public T printPureStackTrace(T appendable, String indent, { safeAppendable.append("NULL / TODO"); } - writeSourceInformationMessage(safeAppendable.append(" <- "), x.getSourceInformation(), false); + writeSourceInformationMessage(safeAppendable.append(" ("), x.getSourceInformation(), false); + safeAppendable.append(")"); }); } return appendable; diff --git a/legend-pure-runtime/legend-pure-runtime-java-engine-interpreted/src/test/java/org/finos/legend/pure/runtime/java/interpreted/runtime/api/TestFunctionExecutionStart.java b/legend-pure-runtime/legend-pure-runtime-java-engine-interpreted/src/test/java/org/finos/legend/pure/runtime/java/interpreted/runtime/api/TestFunctionExecutionStart.java index d7cbaf02c8..075732f155 100644 --- a/legend-pure-runtime/legend-pure-runtime-java-engine-interpreted/src/test/java/org/finos/legend/pure/runtime/java/interpreted/runtime/api/TestFunctionExecutionStart.java +++ b/legend-pure-runtime/legend-pure-runtime-java-engine-interpreted/src/test/java/org/finos/legend/pure/runtime/java/interpreted/runtime/api/TestFunctionExecutionStart.java @@ -122,11 +122,11 @@ public void testCallStackInExecutionExceptionPure() Assert.assertEquals( " 1: resource:/platform/pure/essential/tests/assert.pure line:26 column:5\n" + "\n" + - " Full Stack:\n" + - " nest():Boolean[1] <- resource:fromString.pure line:4 column:8\n" + - " fail():Boolean[1] <- resource:fromString.pure line:7 column:31\n" + - " assert(Boolean[1]):Boolean[1] <- resource:/platform/pure/essential/tests/fail.pure line:19 column:5\n" + - " assert(Boolean[1], String[1]):Boolean[1] <- resource:/platform/pure/essential/tests/assert.pure line:31 column:5\n" + - " assert(Boolean[1], Function<{->String[1]}>[1]):Boolean[1] <- resource:/platform/pure/essential/tests/assert.pure line:26 column:5", trace); + " Full stacktrace:\n" + + " at assert(Boolean[1], Function<{->String[1]}>[1]):Boolean[1] (resource:/platform/pure/essential/tests/assert.pure line:26 column:5)\n" + + " at assert(Boolean[1], String[1]):Boolean[1] (resource:/platform/pure/essential/tests/assert.pure line:31 column:5)\n" + + " at assert(Boolean[1]):Boolean[1] (resource:/platform/pure/essential/tests/fail.pure line:19 column:5)\n" + + " at fail():Boolean[1] (resource:fromString.pure line:7 column:31)\n" + + " at nest():Boolean[1] (resource:fromString.pure line:4 column:8)", trace); } }