处理异常时附加常规异常catch是一种好习惯.一个例子可以使这个问题更清楚
try{
// do something
}catch(spomespecificException1 ex){
//logging and other stuff
}catch(spomespecificException2 ex){
//logging and other stuff
}catch(Exception ex){
//logging and other stuff
}
Run Code Online (Sandbox Code Playgroud)
我应该将异常catch附加到堆栈