Skip to content
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: poor error message on scalar deserialization type mismatch #1187

Merged
merged 3 commits into from
Jan 12, 2020

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Jan 9, 2020

When deserializing a scalar (string, boolean, number, ...), and receiving a value that is not
a scalar, the error message would not mention what kind of scalar value was required, making
the message less useful than it could be.

Used the description of the type reference in the error message so that the specific scalar
type is direction mentioned in the error message there. The description of the incorrect
value that was received remains unchanged (typically the JSON representation of the value),
and may be improved in a subsequent change.

Improves the situation identified in #1182, however does not fix the whole problem.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When deserializing a scalar (string, boolean, number, ...), and receiving a value that is not
a scalar, the error message would not mention waht kind of scalar value was required, making
the message less useful than it could be.

Used the description of the type reference in the error message so that the specific scalar
type is direction mentioned in the error message there. The description of the incorrect
value that was received remains unchanged (typically the JSON representation of the value),
and may be improved in a subsequent change.
@RomainMuller RomainMuller requested a review from a team as a code owner January 9, 2020 16:15
@@ -53,7 +53,6 @@
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"**/bin/**/*.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because there is no bin in there anymore :)

yarn.lock Outdated
Comment on lines 1331 to 1335
"@types/xmldom@^0.1.29":
version "0.1.29"
resolved "https://registry.yarnpkg.com/@types/xmldom/-/xmldom-0.1.29.tgz#c4428b0ca86d3b881475726fd94980b38a27c381"
integrity sha1-xEKLDKhtO4gUdXJv2UmAs4onw4E=

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was previously introduced by error but is no longer depended on. It's unrelated to the change at hand, but it's small enough I don't mind bundling.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a "before" and "after" example message to the PR description.

@mergify
Copy link
Contributor

mergify bot commented Jan 12, 2020

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Jan 12, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit fdf8927 into master Jan 12, 2020
@mergify mergify bot deleted the rmuller/improve-type-mismatch-error branch January 12, 2020 13:53
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants