From 3c37b91adbb038de70fa54be78fcfb6c5889ec62 Mon Sep 17 00:00:00 2001 From: mccraig mccraig of the clan mccraig Date: Thu, 31 Mar 2011 12:30:23 +0100 Subject: [PATCH] log in the case that Crack barfs while parsing SOAP response --- lib/savon/soap/xml.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/savon/soap/xml.rb b/lib/savon/soap/xml.rb index a682dba3..99eda56e 100644 --- a/lib/savon/soap/xml.rb +++ b/lib/savon/soap/xml.rb @@ -28,7 +28,12 @@ def self.to_hash(value) # Converts a given SOAP response +xml+ to a Hash. def self.parse(xml) - Crack::XML.parse(xml) rescue {} + begin + Crack::XML.parse(xml) + rescue Exception=>e + Savon.log(e) + {} + end end # Expects a SOAP response XML or Hash, traverses it for a given +path+ of Hash keys