@@ -205,7 +205,11 @@ export class ArduinoApp {
205
205
const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README." ;
206
206
arduinoChannel . warning ( msg ) ;
207
207
}
208
- await util . spawn ( this . _settings . commandPath , arduinoChannel . channel , args ) . then ( async ( ) => {
208
+ await util . spawn (
209
+ this . _settings . commandPath ,
210
+ arduinoChannel . channel ,
211
+ args ,
212
+ ) . then ( async ( ) => {
209
213
UsbDetector . getInstance ( ) . resumeListening ( ) ;
210
214
if ( needRestore ) {
211
215
await serialMonitor . openSerialMonitor ( ) ;
@@ -283,22 +287,23 @@ export class ArduinoApp {
283
287
let success = false ;
284
288
const compilerParserContext = makeCompilerParserContext ( dc ) ;
285
289
286
- try {
287
- await util . spawn ( this . _settings . commandPath ,
288
- arduinoChannel . channel ,
289
- args ,
290
- undefined ,
291
- compilerParserContext . callback ) ;
290
+ await util . spawn (
291
+ this . _settings . commandPath ,
292
+ arduinoChannel . channel ,
293
+ args ,
294
+ undefined ,
295
+ compilerParserContext . callback ,
296
+ ) . then ( ( ) => {
292
297
arduinoChannel . end ( `Finished verifying sketch - ${ dc . sketch } ${ os . EOL } ` ) ;
293
298
success = true ;
294
- } catch ( reason ) {
299
+ } , ( reason ) => {
295
300
const msg = reason . code ?
296
301
`Exit with code=${ reason . code } ${ os . EOL } ` :
297
302
reason . message ?
298
303
reason . message :
299
304
JSON . stringify ( reason ) ;
300
305
arduinoChannel . error ( msg ) ;
301
- }
306
+ } ) ;
302
307
303
308
if ( compilerParserContext . conclude ) {
304
309
compilerParserContext . conclude ( ) ;
0 commit comments