Exception: ThinkingSphinx::SphinxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/thinking_sphinx/errors.rb

Direct Known Subclasses

QueryError

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Attribute Details

- (Object) statement

Returns the value of attribute statement



2
3
4
# File 'lib/thinking_sphinx/errors.rb', line 2

def statement
  @statement
end

Class Method Details

+ (Object) new_from_mysql(error)



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/thinking_sphinx/errors.rb', line 4

def self.new_from_mysql(error)
  case error.message
  when /parse error/
    replacement = ThinkingSphinx::ParseError.new(error.message)
  when /syntax error/
    replacement = ThinkingSphinx::SyntaxError.new(error.message)
  when /query error/
    replacement = ThinkingSphinx::QueryError.new(error.message)
  else
    replacement = new(error.message)
  end

  replacement.set_backtrace error.backtrace
  replacement.statement = error.statement if error.respond_to?(:statement)
  replacement
end