Add support for errors without line number

This commit is contained in:
Yurin Slava 2012-06-18 10:44:35 +07:00 committed by Tuncer Ayaz
parent 3dce05314b
commit 7bef458163

View file

@ -245,4 +245,7 @@ format_error(AbsSource, Extra, {{Line, Column}, Mod, Desc}) ->
?FMT("~s:~w:~w: ~s~s~n", [AbsSource, Line, Column, Extra, ErrorDesc]); ?FMT("~s:~w:~w: ~s~s~n", [AbsSource, Line, Column, Extra, ErrorDesc]);
format_error(AbsSource, Extra, {Line, Mod, Desc}) -> format_error(AbsSource, Extra, {Line, Mod, Desc}) ->
ErrorDesc = Mod:format_error(Desc), ErrorDesc = Mod:format_error(Desc),
?FMT("~s:~w: ~s~s~n", [AbsSource, Line, Extra, ErrorDesc]). ?FMT("~s:~w: ~s~s~n", [AbsSource, Line, Extra, ErrorDesc]);
format_error(AbsSource, Extra, {Mod, Desc}) ->
ErrorDesc = Mod:format_error(Desc),
?FMT("~s: ~s~s~n", [AbsSource, Extra, ErrorDesc]).