Do you really need to handle every exception individually? e.g. would
try {
$input->get('var1');
$input->get('var2');
$input->get('var3');
$input->get('var4');
} catch (Exception $e) {
... do something
}
work just as well? With this construct, any of the get() calls that fail would trigger the catch and further get() calls will not be performed. e.g if var2
throws, then var3 and var4 will never be gotten.