Exception: Traject::SolrPool::SolrJsonWriter::BadHttpResponse

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/traject/solr_pool/solr_json_writer.rb

Overview

Raised when Solr returns a non-2xx response; carries the raw response. Its #response is an http.rb HTTP::Response (use #code / #to_s), not an HTTPClient message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, response = nil) ⇒ BadHttpResponse

Returns a new instance of BadHttpResponse.



32
33
34
35
36
37
# File 'lib/traject/solr_pool/solr_json_writer.rb', line 32

def initialize(msg, response = nil)
  solr_error = find_solr_error(response)
  msg = "#{msg}: #{solr_error}" if solr_error
  super(msg)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



30
31
32
# File 'lib/traject/solr_pool/solr_json_writer.rb', line 30

def response
  @response
end