"bitshit" <bitshit_at_hot_mail_dot_com> wrote in message
news:4303aab0$0$767$. nl...
> Hi,
>
> Is it possible to redirect java errors to post to a url? I have a generic
> library that some third party classes extend. When these third party
> classes generate errors/crash i'd like to post these errors to a script
> instead of the jvm printing it standard to the console... it concerns
> applets, the third party applets extend a super class form my library
> where I migth be able to set such a redirect?
I think this kind of stuff is usually done via exception handling,
except it assumes that you are invoking the methods which are generating the
exception, and not the other way around. (Obligatory Slashdot reference: In
Soviet Russia, methods generating exceptions invokes you!)
You could try inverting the call hiearchy, by forcing the third party
code to pass you something like a method pointer or delegate (or something
like the Command design pattern), and then your library code calls this
delegate, and catch any exception it throws, and post to whatever URL you
want.
- Oliver
|