@@ -133,7 +133,7 @@ export class ArduinoApp {
133
133
const prebuildargs = dc . prebuild . split ( " " ) ;
134
134
const prebuildCommand = prebuildargs . shift ( ) ;
135
135
try {
136
- await util . spawn ( prebuildCommand , arduinoChannel . channel , prebuildargs , { shell : true , cwd : ArduinoWorkspace . rootPath } ) ;
136
+ await util . spawn ( prebuildCommand , arduinoChannel . channel , prebuildargs , { shell : true , cwd : ArduinoWorkspace . rootPath } ) ;
137
137
} catch ( ex ) {
138
138
arduinoChannel . error ( `Run prebuild failed: \n${ ex . error } ` ) ;
139
139
return ;
@@ -215,7 +215,7 @@ export class ArduinoApp {
215
215
216
216
const appPath = path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ;
217
217
const args = [ "--upload" , "--board" , boardDescriptor , "--port" , dc . port , "--useprogrammer" ,
218
- "--pref" , "programmer=" + selectProgrammer , appPath ] ;
218
+ "--pref" , "programmer=" + selectProgrammer , appPath ] ;
219
219
if ( VscodeSettings . getInstance ( ) . logLevel === "verbose" ) {
220
220
args . push ( "--verbose" ) ;
221
221
}
@@ -269,7 +269,7 @@ export class ArduinoApp {
269
269
const prebuildargs = dc . prebuild . split ( " " ) ;
270
270
const prebuildCommand = prebuildargs . shift ( ) ;
271
271
try {
272
- await util . spawn ( prebuildCommand , arduinoChannel . channel , prebuildargs , { shell : true , cwd : ArduinoWorkspace . rootPath } ) ;
272
+ await util . spawn ( prebuildCommand , arduinoChannel . channel , prebuildargs , { shell : true , cwd : ArduinoWorkspace . rootPath } ) ;
273
273
} catch ( ex ) {
274
274
arduinoChannel . error ( `Run prebuild failed: \n${ ex . error } ` ) ;
275
275
return ;
@@ -303,7 +303,12 @@ export class ArduinoApp {
303
303
arduinoChannel . end ( `Finished verify sketch - ${ dc . sketch } ${ os . EOL } ` ) ;
304
304
return true ;
305
305
} catch ( reason ) {
306
- arduinoChannel . error ( `Exit with code=${ reason . code } ${ os . EOL } ` ) ;
306
+ const msg = reason . code ?
307
+ `Exit with code=${ reason . code } ${ os . EOL } ` :
308
+ reason . message ?
309
+ reason . message :
310
+ JSON . stringify ( reason ) ;
311
+ arduinoChannel . error ( msg ) ;
307
312
return false ;
308
313
}
309
314
@@ -315,7 +320,7 @@ export class ArduinoApp {
315
320
return ;
316
321
}
317
322
const cppConfigFile = fs . readFileSync ( configFilePath , "utf8" ) ;
318
- const cppConfig = JSON . parse ( cppConfigFile ) as { configurations : Array < { includePath : string [ ] , forcedInclude : string [ ] } > } ;
323
+ const cppConfig = JSON . parse ( cppConfigFile ) as { configurations : Array < { includePath : string [ ] , forcedInclude : string [ ] } > } ;
319
324
const libPaths = this . getDefaultPackageLibPaths ( ) ;
320
325
const defaultForcedInclude = this . getDefaultForcedIncludeFiles ( ) ;
321
326
const configuration = cppConfig . configurations [ 0 ] ;
0 commit comments