views:

21

answers:

1

when deleting an entity in nhibernate i get an exception with 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.

+5  A: 

Yes, you can implement ISQLExceptionConverter to customize the exceptions thrown by NHibernate.

Here's a complete example.

Diego Mijelshon
great, thanks Diego, that exactly what i need.
Nour Sabouny