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 incorrect usage of Try::Tiny #108

Merged
merged 1 commit into from
Feb 3, 2017
Merged

Fix incorrect usage of Try::Tiny #108

merged 1 commit into from
Feb 3, 2017

Conversation

genio
Copy link
Member

@genio genio commented Feb 3, 2017

As was pointed out in Issue #107 an error was introduced with moving from raw evals to Try::Tiny within LWP::UserAgent->simple_request.

This fix should accurately trap the errors and return the error response when found. Also, a few new tests were added to t/base/ua.t to test the ways in which the call to ->prepare_request can die from within ->simple_request.

@oalders oalders merged commit 2c94749 into master Feb 3, 2017
@oalders oalders deleted the genio/fixtry branch February 3, 2017 20:11
@skington
Copy link

skington commented Feb 3, 2017

There's at least one other similar bug.

@genio
Copy link
Member Author

genio commented Feb 3, 2017

@skington I'll move the next call outside of the catch block.

@skington
Copy link

skington commented Feb 4, 2017

That's not the problem I was referring to; rather, you have a return statement inside a catch block, which won't actually return from sub request, so instead it will return $response instead, which was not what was intended.

@genio
Copy link
Member Author

genio commented Feb 4, 2017

@skington Ah. I can see where you'd think that. However, the mix of tabs and spaces are throwing off where you're seeing the end of the catch {} block. That block ends here:

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