Exception: Traject::SolrPool::SolrJsonWriter::BadHttpResponse
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Traject::SolrPool::SolrJsonWriter::BadHttpResponse
- 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
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(msg, response = nil) ⇒ BadHttpResponse
constructor
A new instance of BadHttpResponse.
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
#response ⇒ Object (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 |