I tried inserting two rows the same unique index. sqlite3_step() failed, as expected, but returned 1 (SQLITE_ERROR). Even sqlite3_errcode() returned 1 (SQLITE_ERROR). I would have expected error 19 (SQLITE_CONSTRAINT) to be returned.
I got bit by this as well. However go and look at the docs where it clearly states what happens.
http://www.sqlite.org/capi3ref.html#sqlite3_step
The return value will be either SQLITE_BUSY, SQLITE_DONE, SQLITE_ROW, SQLITE_ERROR, or SQLITE_MISUSE.
You have to use finalize or reset to get the actual error code. That isn't a burden since you always have to call finalize (or reset) anyway.
Roger