File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -175,13 +175,25 @@ class ServerlessStepFunctions {
175175 if ( result . status === 'FAILED' ) {
176176 return this . getExecutionHistory ( )
177177 . then ( ( error ) => {
178- this . serverless . cli . consoleLog ( _ . merge ( result , error . events [ error . events . length - 1 ]
179- . executionFailedEventDetails ) ) ;
178+ const errorMsg = _ . merge (
179+ result ,
180+ error . events . find ( ev => ev . type === 'ExecutionFailed' )
181+ . executionFailedEventDetails
182+ )
183+ try {
184+ this . serverless . cli . consoleLog ( JSON . stringify ( errorMsg , null , 2 ) ) ;
185+ } catch ( e ) {
186+ this . serverless . cli . consoleLog ( errorMsg )
187+ }
180188 process . exitCode = 1 ;
181189 } ) ;
182190 }
183191
184- this . serverless . cli . consoleLog ( result ) ;
192+ try {
193+ this . serverless . cli . consoleLog ( JSON . stringify ( result , null , 2 ) ) ;
194+ } catch ( e ) {
195+ this . serverless . cli . consoleLog ( result ) ;
196+ }
185197 return BbPromise . resolve ( ) ;
186198 } ) ;
187199 }
You can’t perform that action at this time.
0 commit comments