Skip to content

Commit

Permalink
fixup! feat: Add entity name to validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledgarbaya committed Jan 30, 2018
1 parent 32588c2 commit 1462381
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/utils/validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const assertPayload = (payload) => {
const result = Joi.validate(payload, payloadSchema)
if (result.error) {
attachEntityName(result.error.details, payload)
result.error.message = 'Payload validation error'
delete result.error._object
throw result.error
}
}
Expand Down

0 comments on commit 1462381

Please sign in to comment.