Try Catch from another method:
method1(){
try {
method2();
}catch(Exception e){
}
}
method2(){
try{
//ERROR FROM HERE
}catch(Exception e){
}
}
How will method1() catch the error from method2()?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
method1()will not catch the error, unless you re-throw it from thecatchblock inmethod2().