Is it a bad or Good programming practice if i have a code like this for my exception :
try
{
.....
}
catch (abcException a)
{
...do this...
...display this on screen...
...button press event handler code...
}
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.
I guess this is perfectly fine, I mean after event handling you may execute your desired function or gracefully keep running your code too.
Scenario such as, Oops we could not connect to a bluetooth device because of blah blah blah exception, and then ask user would you like to try again or cancel, If they click try again than recursively call same function which hits your try catch block again…(Do this after certain second of countdown)
Still it depends 🙂