Module: Elastic::Client::Error

Defined in:
lib/elastic/client/error.rb

Instance Method Summary collapse

Instance Method Details

#responseObject



14
15
16
17
18
19
20
# File 'lib/elastic/client/error.rb', line 14

def response
  return @response if defined?(@response)

  if captures = message.match(/(?<response>\{.+\})$/)
    @response = JSON.parse(captures[:response])
  end
end

#statusObject



6
7
8
9
10
11
12
# File 'lib/elastic/client/error.rb', line 6

def status
  return @status if defined?(@status)

  if captures = message.match(/^\[(?<status>\d+)\]/)
    @status = captures[:status].to_i
  end
end