File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -175,13 +175,25 @@ class ServerlessStepFunctions {
175
175
if ( result . status === 'FAILED' ) {
176
176
return this . getExecutionHistory ( )
177
177
. 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
+ }
180
188
process . exitCode = 1 ;
181
189
} ) ;
182
190
}
183
191
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
+ }
185
197
return BbPromise . resolve ( ) ;
186
198
} ) ;
187
199
}
You can’t perform that action at this time.
0 commit comments