lib/proxies/response_wrapper.rb
# When an exception occurs, log an error and return the body with error info.
When an exception occurs, log an error and return the body with error info.
When an exception occurs log an error and return the body with error info .
def handle_exception(e, key, opts)
    if e.is_a?(Errors::ProxyError)
      message_lines = [e.message, "Associated key: #{key}#{e.uid_and_response_body}"]
      response = e.response
    else
      message_lines = ["#{e.class} #{e.message}", "Associated key: #{key}"]
    end
    message_lines << e.backtrace.join("\n ") unless Rails.env == "test"
    Rails.logger.error message_lines.join("\n")
    response || default_response(opts)
  end
def handle_exception ( e , key , opts ) if e . is_a? ( Errors :: ProxyError ) message_lines = [ e . message , "Associated key: #{key}#{e.uid_and_response_body}" ] response = e . response else message_lines = [ "#{e.class} #{e.message}" , "Associated key: #{key}" ] end message_lines << e . backtrace . join ( "\n " ) unless Rails . env == "test" Rails . logger . error message_lines . join ( "\n" ) response || default_response ( opts ) end
When an exception occurs, log an error and return the body with error info.
When an exception occurs log an error and return the body with error info .
e
<not_specific>
key
<not_specific>
opts
<not_specific>