From 0716cf708ca3d3d61d2435b88e6d68410a49db6e Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 5 Jun 2012 20:54:05 +0200 Subject: [PATCH] Add support for {Line,Column} in error reports --- src/rebar_base_compiler.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl index 3750e5b..dacb44d 100644 --- a/src/rebar_base_compiler.erl +++ b/src/rebar_base_compiler.erl @@ -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]).