Open GoogleCodeExporter opened 8 years ago
Original comment by noah.hart@gmail.com
on 11 Nov 2011 at 1:33
What can also be done is to actually set the Exception's ErrorCode to the
appropriate SqliteError enum value. Then a generic exception can be thrown as
well and we could use this value instead of having to check all the Exception
types
Original comment by mattleib...@gmail.com
on 29 Mar 2012 at 1:28
And just to say again, this is quite important as it causes unit test to fail
and we do need to know if something fails.
if ( err == SqliteError.BUSY )
throw new SqliteBusyException();
if ( err == SqliteError.MISUSE )
throw new SqliteExecutionException();
// ...
if (err != SqliteError.ROW && err != SqliteError.DONE)
throw new SqliteExecutionException((int)err);
// err is either ROW or DONE.
return err == SqliteError.ROW;
Original comment by mattleib...@gmail.com
on 30 Mar 2012 at 12:17
I have crated a patch that may help. It now will be similar to
System.Data.Sqlite and Mono.Data.Sqlite.
I know that I have duplicated the Error codes enum and messages array, but
there are some reasons:
- Firstly, the duplicated enum has both the same names and casing as the other
two libraries. This is important as I would like to use minimal code
differences in my cross platform projects (Mono for Android and Windows Phone).
- The duplicated messages can allow for more user friendly messages. There will
have to be updates to either the SqliteException or the SqliteCommand and
SqliteDataReader classes as both sets add the error message to the exception
message text: the two by passing the result of Sqlite3.GetError3() to the
exceptionand then again the exception by looking at the message array.
I included both options so that whoever commits this patch (hopefully it will),
can choose.
Original comment by mattleib...@gmail.com
on 8 Apr 2012 at 8:31
Attachments:
Thank you, patch accepted into current release
Original comment by market.n...@gmail.com
on 10 Apr 2012 at 1:41
Original issue reported on code.google.com by
tanza...@gmail.com
on 5 Nov 2011 at 2:50