Implements asserts that throw exceptions.