db.sqlite: fix ERROR:

db4
Doug Coleman 2015-08-13 00:18:29 -07:00
parent 9618704660
commit eeb7cf508f
1 changed files with 4 additions and 4 deletions

View File

@ -11,18 +11,18 @@ IN: db.sqlite.lib
ERROR: sqlite-error < db-error n string ; ERROR: sqlite-error < db-error n string ;
ERROR: sqlite-sql-error < sql-error n string ; ERROR: sqlite-sql-error < sql-error n string ;
: throw-sqlite-error ( n -- * ) : sqlite-other-error ( n -- * )
dup sqlite-error-messages nth sqlite-error ; dup sqlite-error-messages nth throw-sqlite-error ;
: sqlite-statement-error ( -- * ) : sqlite-statement-error ( -- * )
SQLITE_ERROR SQLITE_ERROR
db-connection get handle>> sqlite3_errmsg sqlite-sql-error ; db-connection get handle>> sqlite3_errmsg throw-sqlite-sql-error ;
: sqlite-check-result ( n -- ) : sqlite-check-result ( n -- )
{ {
{ SQLITE_OK [ ] } { SQLITE_OK [ ] }
{ SQLITE_ERROR [ sqlite-statement-error ] } { SQLITE_ERROR [ sqlite-statement-error ] }
[ throw-sqlite-error ] [ sqlite-other-error ]
} case ; } case ;
: sqlite-open ( path -- db ) : sqlite-open ( path -- db )