@@ -180,10 +180,15 @@ export class ArduinoApp {
180
180
public async installBoard ( packageName : string , arch : string , version : string = "" , showOutput : boolean = true ) {
181
181
arduinoChannel . show ( ) ;
182
182
arduinoChannel . start ( `Install package - ${ packageName } ...` ) ;
183
- await util . spawn ( this . _settings . commandPath ,
184
- showOutput ? arduinoChannel . channel : null ,
185
- [ "--install-boards" , `${ packageName } :${ arch } ${ version && ":" + version } ` ] ) ;
186
- arduinoChannel . end ( `Installed board package - ${ packageName } ${ os . EOL } ` ) ;
183
+ try {
184
+ await util . spawn ( this . _settings . commandPath ,
185
+ showOutput ? arduinoChannel . channel : null ,
186
+ [ "--install-boards" , `${ packageName } :${ arch } ${ version && ":" + version } ` ] ) ;
187
+
188
+ arduinoChannel . end ( `Installed board package - ${ packageName } ${ os . EOL } ` ) ;
189
+ } catch ( error ) {
190
+ arduinoChannel . error ( `Exit with code=${ error . code } ${ os . EOL } ` ) ;
191
+ }
187
192
}
188
193
189
194
public uninstallBoard ( boardName : string , packagePath : string ) {
@@ -195,11 +200,15 @@ export class ArduinoApp {
195
200
public async installLibrary ( libName : string , version : string = "" , showOutput : boolean = true ) {
196
201
arduinoChannel . show ( ) ;
197
202
arduinoChannel . start ( `Install library - ${ libName } ` ) ;
198
- await util . spawn ( this . _settings . commandPath ,
199
- showOutput ? arduinoChannel . channel : null ,
200
- [ "--install-library" , `${ libName } ${ version && ":" + version } ` ] ) ;
203
+ try {
204
+ await util . spawn ( this . _settings . commandPath ,
205
+ showOutput ? arduinoChannel . channel : null ,
206
+ [ "--install-library" , `${ libName } ${ version && ":" + version } ` ] ) ;
201
207
202
- arduinoChannel . end ( `Installed libarray - ${ libName } ${ os . EOL } ` ) ;
208
+ arduinoChannel . end ( `Installed library - ${ libName } ${ os . EOL } ` ) ;
209
+ } catch ( error ) {
210
+ arduinoChannel . error ( `Exit with code=${ error . code } ${ os . EOL } ` ) ;
211
+ }
203
212
}
204
213
205
214
public uninstallLibrary ( libName : string , libPath : string ) {
0 commit comments