Java Trigger Return

Asked

Viewed 183 times

-3

I have a Rigger that checks if the user login has more than 3 characters and if it does not have it returns the msg "login must have more than 3 characters", how can I capture this return in java and show in a Joptionpane? with the try catch(Exception e) it only shows java.lang.Exception...

try {
                occurrence.insert(ocorrencia, usuarioLogado);                
            } catch (Exception e) {

                JOptionPane.showMessageDialog(null, e.getMessage());

            }

Grateful

  • If you change the e.getMessage() for e.getErrorCode() show the bank’s custom message?

  • No such method to use..

  • No catch change the Exception for SQLException see if it shows up.

  • I solved with e.getcause(). getmessage(). toString;

1 answer

1


I was able to solve the problem using the

e.getCause().getMessage().toString();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.