Shopify/active_shipping — pull request #130 by christianblais (2014-01-06 19:52:38+00:00)
Title: Catches NoMethodError and reraise a ResponseContentError error

Fixes https://github.com/Shopify/shopify/issues/12855

This error happens when Shipwire returns an empty response or a badly formatted XML. We never check for the response validity, so of course, we eventually encounters some weird behaviour. In this specific case, we were trying to call `document.root.elements`, where `document.root` returns `nil`.

With this fix, we captures `NoMethodError` and raise a `ResponseContentError`.

Any thoughts?

@costford @csaunders for review