开发者

customize error message for nhibernate

开发者 https://www.devze.com 2023-01-17 21:18 出处:网络
when deleting an entity in nhibernate i get an exception wi开发者_运维技巧th this error message:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消