Return Java Trigger [closed]

-3

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

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

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

            }

Thankful

    
asked by anonymous 12.12.2016 / 17:03

1 answer

1

I was able to solve the problem using

e.getCause().getMessage().toString();
    
12.12.2016 / 20:18