I have a method which writes in database but if it is not able to write in database then I catch it as Runtime exception using Exception Class.
public fun()
{
try
{
writeInDb(....);
}
catch(Exception E)
{
//log the event
}
}
Now I have another function calling this function fun() but it also catches exception and based on outcome it sends message to client whether successful or not. e.g.:
funA()
{
try
{
fun();
}
catch(Exception E)
{
//send message to user
}
}
I have a doubt here that since in fun() I have caught the runtime exception so will funA be able to know that an exception has occurred, so that it may send right message.