-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error logging for data/schema mismatch #518
Conversation
Pull Request Test Coverage Report for Build 813
💛 - Coveralls |
Pull Request Test Coverage Report for Build 827
💛 - Coveralls |
I realized why just throwing an error wasn't giving all of the information. I've pushed a new commit which consolidates the messages from any errors that occur while recursively parsing an attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add tests for this?
@fishcharlie, I've added a test and pushed new commits. Github doesn't seem to be updating the PR for some reason (there site was having issues this morning, may be related). I'm unaware of any way to do this manually. I'll check in on this later; hopefully the automatic update will have kicked in. |
@dobrynin Yeah doesn't look like it updated. Maybe try creating a new commit and push that? Like add a new line, commit that, remove it, commit, and push? |
Cool, seems to have worked now. FYI I used the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary:
The error handling for invalid data seems to have broken after making some callbacks asynchronous. I believe this fixes it.
I had to do something a bit strange: console.logging the error information prior to actually throwing a ParseError. When I tried just throwing a ParseError, for some reason I only got one log in the console. The info came from a top-level attribute, even though the actual offending attribute was nested within that top-level attribute. Separating the log into a separate message made it so both the top-level (parent) attribute and the actually incorrect (nested) attribute logged their info.
GitHub linked issue:
#170, #331
Type (select 1):
Is this a breaking change? (select 1):
Is this ready to be merged into Dynamoose? (select 1):
Are all the tests currently passing on this PR? (select 1):
Other:
npm test
from the root of the project directory to ensure all tests continue to pass