class Elastics::HttpError
Attributes
response[R]
Public Class Methods
new(response, caller_line=nil)
click to toggle source
# File lib/elastics/errors.rb, line 18 def initialize(response, caller_line=nil) @response = response @caller_line = caller_line end
Public Instance Methods
body()
click to toggle source
# File lib/elastics/errors.rb, line 27 def body response.body end
status()
click to toggle source
# File lib/elastics/errors.rb, line 23 def status response.status end
to_hash()
click to toggle source
# File lib/elastics/errors.rb, line 36 def to_hash MultiJson.decode response.body rescue MultiJson::DecodeError {} end
to_s()
click to toggle source
# File lib/elastics/errors.rb, line 31 def to_s log = "#@caller_line\n" if @caller_line "#{log}#{status}: #{body}" end