[ajug-members] Groovy and Exceptions

Justin Fiore justin.fiore at gmail.com
Wed Aug 22 17:07:34 EDT 2007


Hey All,

After Jeff's great talk last night about Groovy, I decided to give it a
whirl.

Can anyone recall what he said about Groovy catching exceptions thrown from
Java calls?

I have my GUI in Groovy and app logic in Java.

The app logic throws an Exception. I want to catch it in my GUI
actionPerformed closure and then display it in a dialog.

Something like this:

button(text:'Refresh LAWN Login Status',
                        actionPerformed: {
                  try{
                      lawnLoginXGUI.lawnLoginX.updateStatus()
                  } catch(Exception e){
                      JOptionPane.showMessageDialog(lawnLoginXGUI.mainFrame,
                              e.getMessage(), "Status Update Attempt Error",
JOptionPane.ERROR_MESSAGE)
                  }
                  })

Where that button is part of a SwingBuilder.

The exception thrown by .updateStatus() isn't being caught by the
surrounding catch statement.

Any ideas?

-- 
Justin Fiore
justin.fiore at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20070822/2c4a71e0/attachment.html 


More information about the ajug-members mailing list