在try catch中总是捕获基类Exception类的好习惯吗?应该在try catch中捕获异常类吗?
try
{
//
// Piece of code
//
}
catch (CustomException $my_ex)
{
// Handle CustomExcepton
}
catch (Exception $other_exceptions)
{
// Handle all other exceptions
}
如果是这样,为什么?