Exception: MongoScript::Multiquery::QueryFailedError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/mongoscript/multiquery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, query, response) ⇒ QueryFailedError

Returns a new instance of QueryFailedError.



12
13
14
15
16
17
18
19
# File 'lib/mongoscript/multiquery.rb', line 12

def initialize(name, query, response)
  @query_name = name
  @query_parameters = query
  @db_response = response
  super("Query #{@query_name} failed with the following response: #{response.inspect}")
  # set the backtrace to everything that's going on except this initialize method
  set_backtrace(caller[1...caller.length])
end

Instance Attribute Details

#db_responseObject

The response from the multiquery Javascript.



10
11
12
# File 'lib/mongoscript/multiquery.rb', line 10

def db_response
  @db_response
end

#query_nameObject

The name of the original query



8
9
10
# File 'lib/mongoscript/multiquery.rb', line 8

def query_name
  @query_name
end

#query_parametersObject

The original query whose execution failed.



6
7
8
# File 'lib/mongoscript/multiquery.rb', line 6

def query_parameters
  @query_parameters
end