Hi there! Hope someone can help me :-)
I looked at this:
And it seems a really nice way of catching unchecked exceptions and sending an email report or something to the developers when an unchecked exception is caught...
But it only works in Applications...
My problem is I have a JApplet, and I want to do a similar thing;
1) User does something that causes an unchecked exception (index error, number format error, etc)
2) Users gets a dialog pop up, aking for a comment on what they were trying to do, and if they want to send the report to the developers
3) User clicks "send", and applet calls server, which fires off an email
Now, I can't use that method (from that link), as I do not create the applet...that is done by the browser...
I have tried (from the sublime to the ridiculous) ;-)
1) Subclassing ThreadGroup to allow me to add the currentThread to my own ThreadGroup (like he has)
-- fails, as I am not allowed to create classes in java.lang.*
2) Using getDelclaredMethod to call "add( Thread )" in the Threadgroup class
-- fails, as I am not allowed to call getDeclaredMethod
3) Use two piped streams to redirect system.err to an inputstream, so that I can have a thread watching this stream
-- fails, as I am not allowed to redirect System.err
Basically, I am coming up against SecurityExceptions each time I try to catch my unchecked exceptions...
Is there a way of hooking them? Without signing my applet? (hehe, I refuse to sign the applet so I can handle errors...it all works -- this is more of a nicety) ;-)
So, has anyone else got any ideas I can try?
Hope so :-)
Yours, lacking inspiration