oysteinkrog / SQLite.Net-PCL

Simple, powerful, cross-platform SQLite client and ORM - Updated version with PCL support
MIT License
353 stars 162 forks source link

Real constraint exception is hidden when it's not a ConstraintNotNull exception #318

Open bartdkmediahuis opened 8 years ago

bartdkmediahuis commented 8 years ago

Is there any particular reason a constraint exception is not logged with the real constraint (and parameter values) in order to detect the real issue ?

I would like to know the real ExtendedErrCode here (instead of r.ToString() and a dump of the source-arguments to the TraceListener). Are you still accepting pull requests and making new NuGet packages ?

if (r == Result.Constraint && sqlitePlatform.SQLiteApi.ExtendedErrCode(Connection.Handle) == ExtendedResult.ConstraintNotNull) { sqlitePlatform.SQLiteApi.Reset(Statement); throw NotNullConstraintViolationException.New(r, sqlitePlatform.SQLiteApi.Errmsg16(Connection.Handle)); } sqlitePlatform.SQLiteApi.Reset(Statement); throw SQLiteException.New(r, r.ToString());