@@ -133,7 +133,7 @@ export class ArduinoApp {
133133 const prebuildargs = dc . prebuild . split ( " " ) ;
134134 const prebuildCommand = prebuildargs . shift ( ) ;
135135 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 } ) ;
137137 } catch ( ex ) {
138138 arduinoChannel . error ( `Run prebuild failed: \n${ ex . error } ` ) ;
139139 return ;
@@ -215,7 +215,7 @@ export class ArduinoApp {
215215
216216 const appPath = path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ;
217217 const args = [ "--upload" , "--board" , boardDescriptor , "--port" , dc . port , "--useprogrammer" ,
218- "--pref" , "programmer=" + selectProgrammer , appPath ] ;
218+ "--pref" , "programmer=" + selectProgrammer , appPath ] ;
219219 if ( VscodeSettings . getInstance ( ) . logLevel === "verbose" ) {
220220 args . push ( "--verbose" ) ;
221221 }
@@ -269,7 +269,7 @@ export class ArduinoApp {
269269 const prebuildargs = dc . prebuild . split ( " " ) ;
270270 const prebuildCommand = prebuildargs . shift ( ) ;
271271 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 } ) ;
273273 } catch ( ex ) {
274274 arduinoChannel . error ( `Run prebuild failed: \n${ ex . error } ` ) ;
275275 return ;
@@ -303,7 +303,12 @@ export class ArduinoApp {
303303 arduinoChannel . end ( `Finished verify sketch - ${ dc . sketch } ${ os . EOL } ` ) ;
304304 return true ;
305305 } 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 ) ;
307312 return false ;
308313 }
309314
@@ -315,7 +320,7 @@ export class ArduinoApp {
315320 return ;
316321 }
317322 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 [ ] } > } ;
319324 const libPaths = this . getDefaultPackageLibPaths ( ) ;
320325 const defaultForcedInclude = this . getDefaultForcedIncludeFiles ( ) ;
321326 const configuration = cppConfig . configurations [ 0 ] ;
0 commit comments