shard-crystal-sqlite3/src/sqlite3/exception.cr
2015-03-12 21:08:01 -03:00

10 lines
266 B
Crystal

# Exception thrown on invalid SQLite3 operations.
class SQLite3::Exception < ::Exception
# The internal code associated with the failure.
getter code
def initialize(db)
super(String.new(LibSQLite3.errmsg(db)))
@code = LibSQLite3.errcode(db)
end
end