Added exception for invalid dtypes per issue #15520
close #15520 

 - [ ] closes #xxxx
 - [ ] tests added / passed
 - [ ] passes ``git diff upstream/master | flake8 --diff``
 - [ ] whatsnew entry

tests! tests! if you'd like to add some tests, ping and can reopen