lib/rews/util.rb
# check the response codes of an Exchange Web Services request.
# the supplied block makes a SOAP request, and the response is parsed
# out and checked
check the response codes of an Exchange Web Services request.
the supplied block makes a SOAP request, and the response is parsed
out and checked
check the response codes of an Exchange Web Services request . the supplied block makes a SOAP request and the response is parsed out and checked
def with_error_check(client, *response_msg_keys)
      raise "no block" if !block_given?
      begin
        response = yield
        hash_response = response.to_hash
        statuses = hash_response.fetch_in(*response_msg_keys)
        if statuses.is_a?(Array)
          all_statuses = statuses
        else
          all_statuses = [statuses]
        end
        errors = all_statuses.map{|s| single_error_check(client, s)}.compact
      rescue Exception=>e
        Rews.log{|logger| logger.warn(e)}
        tag_exception(e, :savon_response=>response)
        raise e
      end
      raise Error.new(errors.join("\n")) if !errors.empty?
      statuses
    end
def with_error_check ( client , * response_msg_keys ) raise "no block" if ! block_given? begin response = yield hash_response = response . to_hash statuses = hash_response . fetch_in ( * response_msg_keys ) if statuses . is_a? ( Array ) all_statuses = statuses else all_statuses = [ statuses ] end errors = all_statuses . map { | s | single_error_check ( client , s ) } . compact rescue Exception => e Rews . log { | logger | logger . warn ( e ) } tag_exception ( e , :savon_response => response ) raise e end raise Error . new ( errors . join ( "\n" ) ) if ! errors . empty? statuses end
check the response codes of an Exchange Web Services request.
check the response codes of an Exchange Web Services request .
client
<not_specific>
response_msg_keys
<not_specific>