raise a `ValueError` if method is not None