I have a Java Web Project that uses Hibernate and MySQL. I have trouble to treat exceptions like when i try to insert a new register at database with the same primary key (Intentionally) i got the following error with a message box "Could not insert:...". But i don't want to shows directly to user this error, i want to treat when i call "Persisten.save()", but in my code it doesn't appears nothing wrong (for my ide, i threat all possible excepetions).
So how can i change (configuration/code) to force threat exceptions like that and change the message?!
|