Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- throw new IllegalArgumentException();
- } catch (Exception e) {
- System.out.println("boom");
- }
- // insert the user
- try {
- hibernateSession.save(user);
- } catch (ConstraintViolationException e) {
- throw new MessageException("Username " + user.getName() + " already exists. Please choose a different name.");
- }
- try {
- ... render the page
- } catch (MessageException e) {
- ... render a nice page with the message
- } catch (Exception e) {
- ... render "we logged your problem but for now you're hosed" message
- }
Add Comment
Please, Sign In to add comment