Skip to content

Commit

Permalink
Merge pull request #2899 from emqx/log-path-when-plugin-template-file…
Browse files Browse the repository at this point in the history
…-load-fails

Log path when plugin template file read fails
  • Loading branch information
ferd authored Jun 12, 2024
2 parents d055c3a + e30cfce commit b562583
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 b562583

Please sign in to comment.