diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl index 0607ded..23ea41c 100644 --- a/src/rebar_erlydtl_compiler.erl +++ b/src/rebar_erlydtl_compiler.erl @@ -190,12 +190,18 @@ do_compile(Source, Target, DtlOpts) -> module_name(Target), Opts) of ok -> ok; + {error, {File, [{Pos, _Mod, Err}]}} -> + ?ERROR("Compiling template ~p failed:~n (~s): ~p~n", + [File, err_location(Pos), Err]); Reason -> ?ERROR("Compiling template ~s failed:~n ~p~n", [Source, Reason]), ?FAIL end. +err_location({L,C}) -> io_lib:format("line:~w, col:~w", [L, C]); +err_location(L) -> io_lib:format("line:~w", [L]). + module_name(Target) -> F = filename:basename(Target), string:substr(F, 1, length(F)-length(".beam")).