@@ -96,18 +96,23 @@ public int run(String... args) throws Exception {
96
96
try {
97
97
Optional <String > missing = checkMissingCommand (cmd , args );
98
98
missing .ifPresent (m -> {
99
- Map <String , Plugin > installable = pluginManager .getInstallablePlugins ();
100
- if (installable .containsKey (m )) {
101
- Plugin candidate = installable .get (m );
102
- PluginListItem item = new PluginListItem (false , candidate );
103
- PluginListTable table = new PluginListTable (List .of (item ));
104
- output .info ("Command %s not installed but the following plugin is available:\n %s" , m , table .getContent ());
105
- if (interactiveMode && Prompt .yesOrNo (true ,
106
- "Would you like to install it now ?" ,
107
- args )) {
108
- pluginManager .addPlugin (m ).ifPresent (added -> plugins .put (added .getName (), added ));
109
- pluginCommandFactory .populateCommands (cmd , plugins );
99
+ try {
100
+ Map <String , Plugin > installable = pluginManager .getInstallablePlugins ();
101
+ if (installable .containsKey (m )) {
102
+ Plugin candidate = installable .get (m );
103
+ PluginListItem item = new PluginListItem (false , candidate );
104
+ PluginListTable table = new PluginListTable (List .of (item ));
105
+ output .info ("Command %s not installed but the following plugin is available:\n %s" , m ,
106
+ table .getContent ());
107
+ if (interactiveMode && Prompt .yesOrNo (true ,
108
+ "Would you like to install it now ?" ,
109
+ args )) {
110
+ pluginManager .addPlugin (m ).ifPresent (added -> plugins .put (added .getName (), added ));
111
+ pluginCommandFactory .populateCommands (cmd , plugins );
112
+ }
110
113
}
114
+ } catch (Exception e ) {
115
+ output .error ("Command %s is missing and can't be installed." , m );
111
116
}
112
117
});
113
118
} catch (MutuallyExclusiveArgsException e ) {
0 commit comments