trapping console errors



hello,
I'm writing a GUI that can be used to interface with a directory server using JNDI. Unfortunately not all the possible errors are Exceptions that have been defined with the JNDI API. Things like invalid passwords will cause an error message to go to the console but I'd like to capture those and put them into a JOptionPane or, better still, to parse them and based on the actual error code I'd like to make my own error message. How can I capture console error messages and deal with them?


thanks
.