class SQLite3::Exception
Attributes
A convenience for accessing the error code for this exception.
If the error is associated with a SQL query, this is the query
If the error is associated with a particular offset in a SQL query, this is the non-negative offset. If the offset is not available, this will be -1.
Public Instance Methods
Source
# File lib/sqlite3/errors.rb, line 15 def message [super, sql_error].compact.join(":\n") end
Calls superclass method
Private Instance Methods
Source
# File lib/sqlite3/errors.rb, line 19 def sql_error return nil unless @sql return @sql.chomp unless @sql_offset >= 0 offset = @sql_offset sql.lines.flat_map do |line| if offset >= 0 && line.length > offset blanks = " " * offset offset = -1 [line.chomp, blanks + "^"] else offset -= line.length if offset line.chomp end end.join("\n") end