Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public InterpreterException(Element trace, String msg, Throwable e) {
@Override
public String getMessage() {
String res = super.getMessage();
if (trace != null) {
if (stackTrace != null) {
res = res + "\n" + stackTrace;
} else if (trace != null) {
WPos pos = trace.attrSource();
res = res + "\n at " + pos.getFile() + ":" + pos.getLine();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static String buildStacktrace(ProgramState globalState, Throwable e) {
StringBuilder err = new StringBuilder();
try {
WPos src = globalState.getLastStatement().attrTrace().attrSource();
err.append("at : ").append(new File(src.getFile()).getName()).append(", line ").append(src.getLine()).append("\n");
err.append("Trace : ").append(new File(src.getFile()).getName()).append(":").append(src.getLine()).append("\n");
} catch (Exception _e) {
// ignore
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ public ILStackFrame(ImCompiletimeExpr f, WPos trace) {

public String getMessage() {
StringBuilder sb = new StringBuilder();
if (trace != null && !trace.isArtificial()) {
String file = new File(trace.getFile()).getName();
sb.append(" ╚ ").append(file).append(":").append(trace.getLine());
}
if (f.isLeft()) {
sb.append("... when calling ").append(f.getLeft().getName()).append("(");
sb.append(" calling ").append(f.getLeft().getName()).append("(");
boolean first = true;
for (ILconst arg : args) {
if (!first) {
Expand All @@ -53,11 +57,6 @@ public String getMessage() {
sb.append("... when executing compiletime expression ");
}

if (trace != null && !trace.isArtificial()) {
String file = new File(trace.getFile()).getName();
sb.append(" in ").append(file).append(":").append(trace.getLine());
}

return sb.toString();
}

Expand Down
Loading