@@ -171,8 +171,8 @@ class RunView extends React.Component<IComponentProperties, IComponentState> {
171171 < div className = 'ArgumentsControl' >
172172 { this . getArgumentsView ( ) }
173173 </ div >
174- < DefaultButton id = 'RunButton' text = 'Run'
175- disabled = { ! this . state . model || ( this . state . capture === Capture . Debug && ! ( this . state . inputPath && this . state . outputPath ) ) }
174+ < DefaultButton id = 'RunButton' text = 'Run'
175+ disabled = { ! this . state . model || ( this . state . capture === Capture . Debug && ! ( this . state . inputPath && this . state . outputPath ) ) }
176176 onClick = { this . execModelRunner } />
177177 </ div >
178178 )
@@ -322,9 +322,13 @@ class RunView extends React.Component<IComponentProperties, IComponentState> {
322322 } ) ;
323323 }
324324
325- private logError = ( error : string | Error ) => {
326- const message = typeof error === 'string' ? error : ( `${ error . stack ? `${ error . stack } : ` : '' } ${ error . message } ` ) ;
327- log . error ( message )
325+ private logError = ( error : string | Error | Error [ ] ) => {
326+ const toString = ( error : string | Error ) => typeof error === 'string' ? error : ( `${ error . stack ? `${ error . stack } : ` : '' } ${ error . message } ` ) ;
327+ if ( Array . isArray ( error ) ) {
328+ log . error ( error . map ( toString ) . join ( '\n' ) ) ;
329+ } else {
330+ log . error ( toString ( error ) ) ;
331+ }
328332 }
329333
330334 private printMessage = ( message : string ) => {
@@ -351,7 +355,7 @@ class RunView extends React.Component<IComponentProperties, IComponentState> {
351355 save ( ModelProtoSingleton . serialize ( true ) , this . getDebugModelPath ( ) ) ;
352356 runPath = debugRunnerPath ;
353357 procParameters = [ this . getDebugModelPath ( ) , this . state . inputPath ] ;
354- }
358+ }
355359
356360 this . setState ( {
357361 console : '' ,
@@ -367,7 +371,7 @@ class RunView extends React.Component<IComponentProperties, IComponentState> {
367371 this . logError ( e ) ;
368372 this . printMessage ( "\n---------------------------\nRun Failed!\n" )
369373 this . printMessage ( `\n${ ( e as Error ) . message } ` )
370-
374+
371375 log . info ( this . state . model + " is failed to run" ) ;
372376 this . setState ( {
373377 currentStep : Step . Idle ,
@@ -393,7 +397,7 @@ class RunView extends React.Component<IComponentProperties, IComponentState> {
393397 ncp . ncp ( ModelProtoSingleton . getCurrentModelDebugDir ( ) , filename , this . copyCallbackFunction ) ;
394398 }
395399
396- private copyCallbackFunction = ( err : Error ) => {
400+ private copyCallbackFunction = ( err : Error [ ] | null ) => {
397401 const runDialogOptions = {
398402 message : '' ,
399403 title : 'run result' ,
@@ -402,7 +406,6 @@ class RunView extends React.Component<IComponentProperties, IComponentState> {
402406 this . logError ( err ) ;
403407 runDialogOptions . message = 'Run failed! See console log for details.'
404408 require ( 'electron' ) . remote . dialog . showMessageBox ( require ( 'electron' ) . remote . getCurrentWindow ( ) , runDialogOptions )
405-
406409 } else {
407410 runDialogOptions . message = 'Run Successful: Debug capture saved to output path'
408411 require ( 'electron' ) . remote . dialog . showMessageBox ( require ( 'electron' ) . remote . getCurrentWindow ( ) , runDialogOptions )
@@ -422,4 +425,4 @@ const mapDispatchToProps = {
422425 setFile,
423426}
424427
425- export default connect ( mapStateToProps , mapDispatchToProps ) ( RunView ) ;
428+ export default connect ( mapStateToProps , mapDispatchToProps ) ( RunView ) ;
0 commit comments