added test for exceptions being thrown correctly.