tlconnor/xero_gateway — pull request #45 by cih (2013-04-20 00:19:03+00:00)
Title: Handle no certificate registered error

Hey guys,

I had no public key certificate against a test xero account I was using, it had expired or been removed without being updated.

I was seeing was a NoMethodError caused by a REXML::Document instance method returning nil on [this line](https://github.com/tlconnor/xero_gateway/blob/master/lib/xero_gateway/http.rb#L114) as there were [no children](http://ruby-doc.org/stdlib-1.9.3/libdoc/rexml/rdoc/REXML/Document.html#method-i-root).

It was not immediately apparent what was causing the problem so I have added a couple of lines to output the response body in this case. Hopefully it will save someone some time in the future!

Cheers