In my project I use Sqlite with Nhibernate and now I want to manage the error handling for my repository.
I found this very nice link, but it has the error codes for SQL Server:
So far so good.
This is the code for error handling in SQL Server:
case 547:
return new ConstraintViolationException(exInfo.Message, sqle.InnerException, exInfo.Sql, null);
case 208:
return new SQLGrammarException(exInfo.Message, sqle.InnerException, exInfo.Sql);
case 3960:
return new StaleObjectStateException(exInfo.EntityName, exInfo.EntityId);
The problem is that I only know the first one. In Sqlite, the error code is 19 for ConstraintViolationException. But for the other ones I can't find an homologation. I checked for it here:
The question is:
Does anybody has experience with Sqlite error handling and know which error codes I could handle?
Is there an homologation for
SQLGrammarExceptionandStaleObjectStateException?Are there more Error codes that I could/should handle?
Thanks for any heads up,
John
Aucun commentaire:
Enregistrer un commentaire