lib/intacctrb/base.rb in intacctrb-0.8.21 vs lib/intacctrb/base.rb in intacctrb-0.9.0

- old
+ new

@@ -64,11 +64,11 @@ @sent_xml = xml url = "https://www.intacct.com/ia/xml/xmlgw.phtml" uri = URI(url) retry_count += 1 - res = Net::HTTP.post_form(uri, 'xmlrequest' => xml, read_timeout: 30) + res = Net::HTTP.post_form(uri, 'xmlrequest' => xml, read_timeout: 60) @response = Nokogiri::XML(res.body) IntacctRB.logger.debug res.body if successful? if key = response.at('//result//RECORDNO') || response.at('//result//key') set_intacct_id key.content if object @@ -86,10 +86,16 @@ if retry_count <= 3 IntacctRB.logger.warn "Net::ReadTimeout in IntacctRB; retrying" retry else IntacctRB.logger.error "Net::ReadTimeout in IntacctRB; retries exhausted" - raise e + @response = { + result: { + errormessage: { + error: [{ description: e }] + } + } + } end end end def successful?