Handle request exceptions gracefully #46

Merged
merged 2 commits into from Mar 8, 2012

Conversation

Projects
None yet
2 participants
@jalvarezsamayoa
Contributor

jalvarezsamayoa commented Mar 4, 2012

I've added a rescue block around the post call to Paypal. The idea is to be able to handle server errors (like when sandbox goes down) gracefully.

Let me know if this is ok or would you like me to refine the error handling.

I was thinking trying to duplicate the Paypal's complete response structure or at least some basic fields like responseEvelope.ack so people can check if there was a problem with the request.

@tc

This comment has been minimized.

Show comment Hide comment
@tc

tc Mar 4, 2012

Owner

Can you incorporate the http response code in the exception?

Also, you don't need the "return" keyword in ruby. The last value will be returned.

Owner

tc commented Mar 4, 2012

Can you incorporate the http response code in the exception?

Also, you don't need the "return" keyword in ruby. The last value will be returned.

tc added a commit that referenced this pull request Mar 8, 2012

Merge pull request #46 from jalvarezsamayoa/master
Handle request exceptions gracefully

@tc tc merged commit c14c580 into tc:master Mar 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment