test exception handling in class