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

Handle EncodingError coming from oj gem #2085

Merged
merged 2 commits into from Jul 23, 2019
Merged

Handle EncodingError coming from oj gem #2085

merged 2 commits into from Jul 23, 2019

Conversation

stiak
Copy link
Contributor

@stiak stiak commented Jul 16, 2019

Also adds some test coverage for the Aws::Json module.

Fixes: #1831

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

For context, I'm using the aws-sdk-kinesis library which sometimes receives <ServiceUnavailableException/> when writing records. The SDK seems to translate these into failure responses when I don't have the oj gem installed, but with it present the EncodingError bubbles all the way out of the SDK.

@cjyclaire
Copy link
Contributor

Thanks for the contribution! Changes looks good to me, could you also update test to cover the "EncodingError" case if possible?

@stiak
Copy link
Contributor Author

stiak commented Jul 16, 2019

Thanks for the contribution! Changes looks good to me, could you also update test to cover the "EncodingError" case if possible?

The context 'invalid JSON' covers the "EncodingError" case. Without the changes EncodingError is raised. Should I update the context description?

@stiak
Copy link
Contributor Author

stiak commented Jul 16, 2019

I've added another test case so there is one for each exception type that Oj raises.

@stiak
Copy link
Contributor Author

stiak commented Jul 23, 2019

@cjyclaire Any other changes I should make on this one?

@cjyclaire cjyclaire merged commit 220d449 into aws:master Jul 23, 2019
@cjyclaire
Copy link
Contributor

Merged! Thanks for the contribution, will be included in the next release : )

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.

Parsing exception raised when ServiceUnavailableException returned
2 participants