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

[elasticsearch] safe-guard when the body is already encoded #78

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

palazzem
Copy link
Contributor

What it does

  • if the Elasticsearch perform_request fails for our instrumentation, ensure the original method is called
  • handles the case where the body is already encoded as a string; in that case the JSON.generate() will fail so we use it as is

Note

Third party libraries encode the body as a String (i.e. Chewy) so we should handle that case

@palazzem palazzem added the bug Involves a bug label Feb 15, 2017
Max: 15

Metrics/PerceivedComplexity:
Max: 15
Copy link
Contributor Author

Choose a reason for hiding this comment

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

relaxing here, we will take in consideration Rubocop in another PR

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ufoot ufoot left a comment

Choose a reason for hiding this comment

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

Yes, generally speaking, encapsulating our things like this makes sense, 100% for ensuring the "real" code is running no matter what.

@galdor
Copy link
Contributor

galdor commented Feb 15, 2017

LGTM. Note that you can use super without arguments.

@palazzem palazzem merged commit 37a0e16 into master Feb 15, 2017
@palazzem palazzem deleted the palazzem/ruby-es-json branch February 15, 2017 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants