Exception: SQLite3::Exception

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject (readonly)

A convenience for accessing the error code for this exception.



6
7
8
# File 'lib/sqlite3/errors.rb', line 6

def code
  @code
end

#sqlObject (readonly)

If the error is associated with a SQL query, this is the query



9
10
11
# File 'lib/sqlite3/errors.rb', line 9

def sql
  @sql
end

#sql_offsetObject (readonly)

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.



13
14
15
# File 'lib/sqlite3/errors.rb', line 13

def sql_offset
  @sql_offset
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/sqlite3/errors.rb', line 15

def message
  [super, sql_error].compact.join(":\n")
end