use better syntax for testing for exceptions