I have an API that I cannot modify which does basically the following:
public void CatchException() {
try {
some code...
} catch (Throwable t) {
System.out.println(t.toString());
}
}
I am calling this API in my method:
public void myMethod() {
try {
someClass.CatchException();
} catch (Throwable t) {
... exception is not recaught
}
}
In the call to the API, the exception is not caught a second time as it was consumed in the API method... This is expected Java behaviour...
Is there a way for me to detect that the exception was thrown in the API method without being able to modify the code of the API?