1. Ludia
  2. Untitled project
  3. dynamodb-mock

Pull requests

#6 Merged
Repository
mhart
Branch
fix-validation-errors
Repository
Ludia
Branch
default

Ensure ValidationException error messages are output correctly

Author
  1. Michael Hart
Reviewers
Description

Prior to this change, any ValidationError would look like this (in both the logger and the 400 HTTP response) - which doesn't seem to bear any resemblance to the actual error thrown:

2013-04-06 19:25:55,793 ERROR [Request logger][Dummy-3] request_id=2 action=PutItem exception=ValidationException body=('[InvalidList(), Invalid("required keys set([u\'Item\', u\'ReturnValues\', u\'TableName\', u\'Expected\', \'request_id\']) not provided",), Invalid("required keys set([u\'Item\', u\'ReturnValues\', u\'TableName\', u\'Expected\', \'request_id\']) not provided",), Invalid("required keys set([u\'Item\', u\'ReturnValues\', u\'TableName\', u\'Expected\', \'request_id\']) not provided",)]',)

Now they make a lot more sense (although, to be honest, still a bit ugly):

2013-04-06 19:27:33,636 ERROR [Request logger][Dummy-3] request_id=10 action=PutItem exception=ValidationException body=("String fields can not be empty for dictionary value @ data[u'Item'][u'createCategory'][u'S']",)
  • Learn about pull requests

Comments (0)