Exception: ThinkingSphinx::SphinxError
- Inherits:
-
StandardError
- Object
- StandardError
- ThinkingSphinx::SphinxError
- Defined in:
- lib/thinking_sphinx/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#statement ⇒ Object
Returns the value of attribute statement.
Class Method Summary collapse
Instance Attribute Details
#statement ⇒ Object
Returns the value of attribute statement.
4 5 6 |
# File 'lib/thinking_sphinx/errors.rb', line 4 def statement @statement end |
Class Method Details
.new_from_mysql(error) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/thinking_sphinx/errors.rb', line 6 def self.new_from_mysql(error) case error. when /parse error/, /query is non-computable/ replacement = ThinkingSphinx::ParseError.new(error.) when /syntax error/ replacement = ThinkingSphinx::SyntaxError.new(error.) when /query error/, /unknown column/ replacement = ThinkingSphinx::QueryError.new(error.) when /Can't connect to( MySQL)? server/, /Communications link failure/, /Lost connection to( MySQL)? server/ replacement = ThinkingSphinx::ConnectionError.new( "Error connecting to Sphinx via the MySQL protocol. #{error.}" ) when /offset out of bounds/ replacement = ThinkingSphinx::OutOfBoundsError.new(error.) else replacement = new(error.) end replacement.set_backtrace error.backtrace replacement.statement = error.statement if error.respond_to?(:statement) replacement end |