catching exception by reference