Skip to content

Commit

Permalink
Add support for {Line,Column} in error reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncer Ayaz committed Jun 11, 2012
1 parent c3fc279 commit 0716cf7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rebar_base_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ format_errors(Source, Extra, Errors) ->
[lists:append([format_error(AbsSource, Extra, Desc) || Desc <- Descs])
|| {_, Descs} <- Errors].

format_error(AbsSource, Extra, {{Line, Column}, Mod, Desc}) ->
ErrorDesc = Mod:format_error(Desc),
?FMT("~s:~w:~w: ~s~s", [AbsSource, Line, Column, Extra, ErrorDesc]);
format_error(AbsSource, Extra, {Line, Mod, Desc}) ->
ErrorDesc = Mod:format_error(Desc),
?FMT("~s:~b: ~s~s", [AbsSource, Line, Extra, ErrorDesc]).
?FMT("~s:~w: ~s~s", [AbsSource, Line, Extra, ErrorDesc]).

0 comments on commit 0716cf7

Please sign in to comment.