nov/paypal-express — pull request #20 by pda (2011-10-31 04:53:08+00:00)
Title: Meaningful details in APIError#message

It's very frustrating getting exceptions like "PayPal API Error" without any hint what went wrong. This is especially true when the errors originate with a third party and may not be reproducible.

Of course it's possible to guard every call to paypal-express with rescue code picking apart the exception to log/report/alert the actual reason.

However it would be nice if paypal-express gave more helpful errors in the first place.

This patch to APIError builds a message based on the short_messages of the individual line items, as long as they are present. Otherwise it falls back to the default "PayPal API Error" message.

What do you think?

PS: Thanks for writing paypal-express! :)