Please consider raising a custom Error, with access to sqlite3_errcode and
sqlite3_extended_errcode.
Otherwise you get people doing crazy string matching on the error messages, and
all the bugs that invariably causes.
e.g.
https://github.com/dotcloud/docker/commit/e8af7fcf6da03da65a379c12c90e6626c31846
ae