Move test for exception into seperate function