diff --git a/eo-runtime/src/main/java/org/eolang/PhSafe.java b/eo-runtime/src/main/java/org/eolang/PhSafe.java index bff4897426..0d5a72d146 100644 --- a/eo-runtime/src/main/java/org/eolang/PhSafe.java +++ b/eo-runtime/src/main/java/org/eolang/PhSafe.java @@ -121,6 +121,14 @@ private static T through(final Action action) { private static String message(final Throwable exp) { final StringBuilder ret = new StringBuilder(0); if (!(exp instanceof ExFailure)) { + final StackTraceElement[] stack = exp.getStackTrace(); + if (stack.length > 0) { + final StackTraceElement last = stack[0]; + ret.append(last.getFileName()); + ret.append(':'); + ret.append(last.getLineNumber()); + ret.append(' '); + } ret.append(exp.getClass().getSimpleName()); } if (exp.getMessage() != null) {