Let's say there are three consecutive function calls in one try
block and all of them throw the same type of exception. How can i figure out which function call threw the caught exception when handling it?
You can put a try-catch block around every single method call.
Or you take a look at the exception stack trace. Their is described which line of code throwed the exception.
getStackTrace()[0].getMethodName()
EDIT:
Throwable
StackTraceElement
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With