class Druid::DataSource::Error

Attributes

error[R]
error_class[R]
error_message[R]
host[R]
response[R]

Public Class Methods

new(response) click to toggle source
# File lib/druid/data_source.rb, line 90
def initialize(response)
  @response = response
  parsed_body = MultiJson.load(response.body)
  @error, @error_message, @error_class, @host = parsed_body.values_at(*%w(
    error
    errorMessage
    errorClass
    host
  ))
end

Public Instance Methods

message() click to toggle source
# File lib/druid/data_source.rb, line 101
def message
  error
end
query_cancelled?() click to toggle source
# File lib/druid/data_source.rb, line 113
def query_cancelled?
  error == 'Query cancelled'.freeze
end
query_interrupted?() click to toggle source
# File lib/druid/data_source.rb, line 109
def query_interrupted?
  error == 'Query interrupted'.freeze
end
query_timeout?() click to toggle source
# File lib/druid/data_source.rb, line 105
def query_timeout?
  error == 'Query timeout'.freeze
end
resource_limit_exceeded?() click to toggle source
# File lib/druid/data_source.rb, line 117
def resource_limit_exceeded?
  error == 'Resource limit exceeded'.freeze
end
unknown_exception?() click to toggle source
# File lib/druid/data_source.rb, line 121
def unknown_exception?
  error == 'Unknown exception'.freeze
end