vendredi 6 novembre 2015

Possible to get specific error details from Android SQLiteConstraintException?

I'm getting the following error for certain data, and concept is clear enough:

android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787)

However, that doesn't help me find which specific record has the invalid FK. Rather than thrash my code and try to isolate every insert with a new transaction, is there any way to turn on (or extract) logging with helpful details such as the table in question or even the FK value that is causing trouble?

Also, I'm using SqlBrite, and have turned debug logging on (that just logs the operations, I still don't get more info on the error)

Aucun commentaire:

Enregistrer un commentaire