If I have a code like this:
void a()
{
try
{
b();
}
catch (MyException)
{
}
}
void b()
{
c();
}
void c()
{
d();
}
void d()
{
}
Assuming no cleanup is needed at any time, it is best to put try {} catch {throw;} around the call to d () in c () and the call to c () in b (), or he considered OK to exclude from d ( ) The bubble before () is "natural" without any intermediate try / catch blocks?
I believe the optional try / catch block acts as a kind of “documentation”, but they seem redundant, so I'm just wondering what other people consider the best.
Sorry if this is all too thorough, I’m trying to deal with exceptions, but I don’t have a good relationship with them yet.
SMR
source
share