lib/cieloz/requisicao/resposta.rb in cieloz-0.0.2 vs lib/cieloz/requisicao/resposta.rb in cieloz-0.0.3
- old
+ new
@@ -18,10 +18,16 @@
}
attr_reader :xml
def self.from xml
- obj = new.from_xml xml
+ obj = new
+ begin
+ obj = obj.from_xml xml
+ rescue
+ # makes it resilient to bad responses,
+ # allowing them to be logged
+ end
obj.instance_variable_set :@xml, xml
obj
end
STATUSES.each do |_, status_type|