class LHC::Error

def to_s

def to_s
  return response.to_s unless response.is_a?(LHC::Response)
  request = response.request
  return unless request.is_a?(LHC::Request)
  debug = []
  debug << [request.method, request.url].map { |str| self.class.fix_invalid_encoding(str) }.join(' ')
  debug << "Options: #{request.scrubbed_options}"
  debug << "Headers: #{request.scrubbed_headers}"
  debug << "Response Code: #{response.code} (#{response.options[:return_code]})"
  debug << "Response Options: #{response.scrubbed_options}"
  debug << response.body
  debug << _message
  debug.map { |str| self.class.fix_invalid_encoding(str) }.join("\n")
end