Updating the `testException` example so that it throws an exception

The other example tests (`testExceptionHasRightMessage` and `testExceptionHasRightCode`) throw an `InvalidArgumentException`, but `testException` doesn't.  For consistency, I'd recommend throwing an `InvalidArgumentException` in `testException`.