Could you try and explain what you mean, possibly, with an example of how you would correct it?
It does not make sense to throw and catch an exception from within the same locality as one could just check the error condition and handle it. For example, my earlier example would be better written as:
switch ($something)
{
case 1:
if ($error)
{
echo 'Oops!';
}
break;
case 2:
// do something else
break;
}
A better use of exceptions would be:
try
{
switch ($something)
{
case 1:
foo(); // could throw an exception
break;
case 2:
// do something else
break;
}
}
catch (Exception $e)
{
echo $e->getMessage();
}