Skip to content

Commit

Permalink
Log path when plugin template file load fails
Browse files Browse the repository at this point in the history
  • Loading branch information
zmstone committed Jun 11, 2024
1 parent cea518c commit e30cfce
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions apps/rebar/src/rebar_templater.erl
Original file line number Diff line number Diff line change
Expand Up @@ -424,16 +424,12 @@ prioritize_templates([{Name, Type, File} | Rest], Valid) ->
load_file(Files, escript, Name) ->
{Name, Bin} = lists:keyfind(Name, 1, Files),
Bin;
load_file(_Files, builtin, Name) ->
{ok, Bin} = file:read_file(Name),
Bin;
load_file(_Files, plugin, Name) ->
{ok, Bin} = file:read_file(Name),
Bin;
load_file(_Files, file, Name) ->
load_file(_Files, Type, Name) when Type =:= builtin;
Type =:= plugin;
Type =:= file ->
case file:read_file(Name) of
{ok, Bin} -> Bin;
{error, Reason} ->
{error, Reason} ->
?ABORT("Failed to load file ~p: ~p\n", [Name, Reason])
end.

Expand Down

0 comments on commit e30cfce

Please sign in to comment.