Skip to content

Commit c5e33d6

Browse files
Merge pull request #311 from aslafy-z/patch-1
feat: human readable errors in state schema validation
2 parents 70edc57 + 163e6c1 commit c5e33d6

File tree

3 files changed

+4489
-1107
lines changed

3 files changed

+4489
-1107
lines changed

lib/deploy/stepFunctions/compileStateMachines.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ module.exports = {
114114

115115
if (stateMachineObj.definition) {
116116
if (this.serverless.service.stepFunctions.validate) {
117-
const { isValid, errors } = aslValidator(stateMachineObj.definition);
117+
const { isValid, errorsText } = aslValidator(stateMachineObj.definition);
118118
if (isValid) {
119119
this.serverless.cli.consoleLog(`✓ State machine "${stateMachineName}" definition is valid`);
120120
} else {
121121
const errorMessage = [
122122
`✕ State machine "${stateMachineName}" definition is invalid:`,
123-
JSON.stringify(errors),
123+
errorsText(),
124124
].join('\n');
125125
throw new this.serverless.classes.Error(errorMessage);
126126
}

0 commit comments

Comments
 (0)