Show plugin name if cannot start it (#2111)

This commit is contained in:
Shawn 2018-12-28 16:37:01 +08:00 committed by GitHub
parent 24ac3e78a2
commit d854120023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -170,10 +170,13 @@ list() ->
plugin(CfgFile) ->
AppName = app_name(CfgFile),
{ok, Attrs} = application:get_all_key(AppName),
case application:get_all_key(AppName) of
{ok, Attrs} ->
Ver = proplists:get_value(vsn, Attrs, "0"),
Descr = proplists:get_value(description, Attrs, ""),
#plugin{name = AppName, version = Ver, descr = Descr}.
#plugin{name = AppName, version = Ver, descr = Descr};
undefined -> error({plugin_not_found, AppName})
end.
%% @doc Load a Plugin
-spec(load(atom()) -> ok | {error, term()}).