Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit c2ede2d

Browse files
fix: improves parsing error and includes only original error message (validateBody)
1 parent ecab140 commit c2ede2d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/units/validateBody.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ Failed to parse a given JSON Schema:
161161
162162
${schema}
163163
164-
Please check if that is a valid JSON and a valid JSON Schema.
164+
Please check that the given JSON Schema is a valid JSON.
165165
166166
Original parsing error:
167-
${error.stack}\
167+
${error.message}\
168168
`);
169169
}
170170
};
@@ -193,7 +193,9 @@ function validateBody(expected, real) {
193193
);
194194

195195
// Attempt to parse a given JSON Schema
196-
// in case it's a raw string.
196+
// to verify that it's a valid JSON.
197+
// TODO Move this into an input validation layer
198+
// once such is introduced.
197199
if (typeof expected.bodySchema === 'string') {
198200
validateJsonSchema(expected.bodySchema);
199201
}

0 commit comments

Comments
 (0)