Exception: Db2Query::QueryDefinitionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/db2_query/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, query_name = nil, column = nil) ⇒ QueryDefinitionError

Returns a new instance of QueryDefinitionError.



58
59
60
61
62
63
# File 'lib/db2_query/error.rb', line 58

def initialize(klass, query_name = nil, column = nil)
  @klass = klass
  @query_name = query_name
  @column = column
  super(message)
end

Instance Method Details

#messageObject



65
66
67
68
69
70
71
72
73
# File 'lib/db2_query/error.rb', line 65

def message
  if @query_name.nil?
    "Definitions::#{@klass}Definitions file not found."
  elsif @column.nil?
    "No query definition found for #{@klass}:#{@query_name}"
  else
    "Column `#{@column}` not found at `#{@klass} query:#{@query_name}` Query Definitions."
  end
end