I have a a misbehaving calling application which I dont have the source for, which confronted with a non 200 http status- quietly logs an error/information message…
I need to be able to make it actually exit with some kind of error message. happen to know that it does catch some exceptions…. so this is my strategy
replace some part of the http client code with one that throws an exception and then let the exception bubble up to this app, where upon I expect it to exit…
Is there any other way/better to do this ? if not better simply suggestions of alternatives also welcome.
Thanks
That seems like a reasonable approach. You could also try using an aspect – if you use load-time weaving, you can add aspects to the client application at the point where you want it to throw an exception (though without the source code it will be tricky to work out the exact pointcut).