customize error message for nhibernate
when deleting an entity in nhibernate i get an exception wi开发者_运维技巧th this error message:
delete statement conflicted with column reference constraint ..etc of course the exception is wrapped in long series of exceptions.the error message is normal, but can i make nhibernate shows more polite error message to the user ??
in another words: is there any conventions which with, i can customize the exception ??I'm using Oracle 11g data base.
Yes, you can implement ISQLExceptionConverter
to customize the exceptions thrown by NHibernate.
Here's a complete example.
精彩评论