Exception: Weaviate::HTTPError
- Defined in:
- lib/weaviate/error.rb,
sig/weaviate.rbs
Overview
Raised when Weaviate responds with a 4xx or 5xx status
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Connection::Response?
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ json
-
#initialize(message = nil, response: nil) ⇒ HTTPError
constructor
A new instance of HTTPError.
- #status ⇒ Integer?
Constructor Details
#initialize(message = nil, response: nil) ⇒ HTTPError
Returns a new instance of HTTPError.
19 20 21 22 |
# File 'lib/weaviate/error.rb', line 19 def initialize( = nil, response: nil) @response = response super( || "the server responded with status #{response&.status}") end |
Instance Attribute Details
#response ⇒ Connection::Response? (readonly)
Returns the value of attribute response.
17 18 19 |
# File 'lib/weaviate/error.rb', line 17 def response @response end |
Instance Method Details
#body ⇒ json
28 29 30 |
# File 'lib/weaviate/error.rb', line 28 def body response&.body end |
#status ⇒ Integer?
24 25 26 |
# File 'lib/weaviate/error.rb', line 24 def status response&.status end |