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