Updating generic.py error message

This is my first attempt at a PR. I just made a little change to allow an error message. Would appreciate some feedback. 
Based on https://github.com/pydata/pandas/issues/8015
why checking for `axis`? (groupby handles the different values for axis)
I think you should just check `if level is None and by is None` and then raise the error, and else the original code