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

Unifies NotFound error handling #126

Closed

Conversation

rthbound
Copy link

I noticed a bit of duplication in the 404/NotFound exception handling across several of the classes under Elasticsearch::API. This pull request should clear that up.

  • Util#__rescue_from_not_found method to standardize NotFound handling
  • Unit tests for the new method
  • YARD documentation for the new method

@rthbound rthbound closed this Jan 28, 2015
@rthbound rthbound reopened this Jan 28, 2015
@rthbound
Copy link
Author

Did not mean to close. Anything more I should do for this?

@karmi
Copy link
Contributor

karmi commented Jan 29, 2015

@rthbound Hi Tad, sorry about the silence -- I have the PR checked out locally, but had to switch priorities. This is a significant change (LOC-wise) so I wanted to think about it a bit. Please ping me in couple of days if I won't reply or merge it.

@rthbound
Copy link
Author

rthbound commented Feb 2, 2015

Closing & Reopening to re-trigger travis build (and to ping @karmi )

I think these build failures are intermittent.

@rthbound rthbound closed this Feb 2, 2015
@rthbound rthbound reopened this Feb 2, 2015
@rthbound rthbound closed this Feb 27, 2015
@karmi
Copy link
Contributor

karmi commented Feb 27, 2015

@rthbound Thanks for staying on this! I've been buried in the dsl branch for a while. It's fine to do a git rebase master and then just git push --force -- the pull request will be updated with new commits. It's better than having to think about two separate issues :)

@karmi karmi reopened this Feb 27, 2015
  - Util#__rescue_from_not_found method to standardize NotFound handling
  - Unit tests for new method

  Example:

    Utils.__rescue_from_not_found do
      # ...
      perform_request(method, path, params, body).status == 200 ? true : false
    end
@rthbound rthbound force-pushed the unifies_not_found_exception_handling branch from 22374c4 to 9635384 Compare February 27, 2015 07:04
@rthbound
Copy link
Author

@karmi No problem! Thanks for the git guidance, and sorry to generate so much noise with this one.

@karmi
Copy link
Contributor

karmi commented Feb 27, 2015

@rthbound Nothing to worry about!, it's not a problem at all! It was just really an advice :)

@karmi
Copy link
Contributor

karmi commented Apr 24, 2015

@rthbound Sorry for sitting on this for so long! I'm glad you did it -- when looking at the code, I just think I would rearrange the code a bit and put the Utils.__rescue_from_not_found directly above the perform_request statement, what do you think? I can do that myself, no worries about the actual change.

@rthbound
Copy link
Author

rthbound commented Apr 26, 2015 via email

@karmi
Copy link
Contributor

karmi commented May 12, 2015

@rthbound Didn't forget, have it checked out locally, but priorities keep popping up before this one... Sorry about that, it's not dead!

@karmi karmi closed this in 4e2a3d3 May 19, 2015
karmi added a commit that referenced this pull request May 19, 2015
@karmi
Copy link
Contributor

karmi commented May 19, 2015

@rthbound Finally got to merge this! Many thanks for the patch and sorry it took so long!

@rthbound
Copy link
Author

@karmi No problem, glad to contribute!

@rthbound
Copy link
Author

@karmi I've recently learned that we may be taking a performance hit by capturing the block object...

How would you feel about removing the &block argument from the #__rescue_from_not_found method signature?

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.

None yet

2 participants