Fix syntax error to handle exceptions.