catching and inspecting exception in test