fix(plugins): avoid crashing when fetching error reason

This commit is contained in:
Thales Macedo Garitezi 2023-06-01 13:09:46 -03:00
parent 64258120d7
commit 648b8231ef
1 changed files with 5 additions and 1 deletions

View File

@ -388,7 +388,11 @@ do_install_package(FileName, Bin) ->
end,
Filtered
),
{error, #{error := Reason}} = hd(Filtered),
Reason =
case hd(Filtered) of
{error, #{error := Reason0}} -> Reason0;
{error, #{reason := Reason0}} -> Reason0
end,
{400, #{
code => 'BAD_PLUGIN_INFO',
message => iolist_to_binary([Reason, ":", FileName])