Where to get database error information in Android SQLite (e.g. failed insert due to violation of not null) Where to get database error information in Android SQLite (e.g. failed insert due to violation of not null) sqlite sqlite

Where to get database error information in Android SQLite (e.g. failed insert due to violation of not null)


I found that one can use insertOrThrow() instead of insert, at least you get an exception when, something goes wrong, saying android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed - even though I actually would wish/expect it would be even clearer and tell me which column has an error or so, but maybe I'm too demanding about SQLIte's feaures here.


Have you looked in LogCat? It's usually pretty verbose about what's going on to include what's going wrong.