Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use conventional FILE:LINE format for locations in stacktraces #9468

Open
wants to merge 1 commit into
base: maint
Choose a base branch
from

Conversation

robertoaloi
Copy link
Contributor

Today, when printing an Erlang stacktrace, we return location information in a custom (PATH, line LINE) format. E.g.:

** exception error: bad argument
     in function  lists:member/2
        called as lists:member(1,not_a_list)
        *** argument 2: not a list
     in call from test:main/0 (test.erl, line 8)

A more common notation would be /path/to/filename:line_number, which is used in many programming tools and languages to specify a location in a file. This would also be in line with what the Erlang compiler returns:

erlc test.erl
test.erl:8:16: syntax error before:
%    8|   lists:member(1
%     |                ^

While the PATH:NUMBER does not seem to be an official standard, it's a widely adopted and understood convention across various development communities.

Switching to the new format would simplify a number of tasks. For example, terminals such as iTerm would recognize this as a link and would allow developers to jump to the correct line number from terminal with a single click.

This change will most likely break some tests, but before fixing them I'm opening the PR to check how open would you be to the change.

Copy link
Contributor

github-actions bot commented Feb 21, 2025

CT Test Results

    2 files     95 suites   1h 6m 51s ⏱️
2 161 tests 2 112 ✅ 48 💤 1 ❌
2 520 runs  2 469 ✅ 50 💤 1 ❌

For more details on these failures, see this check.

Results for commit 05e4563.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant