Assert an exceptipon is thrown.