Import InvalidError instead of looking at global DS
Merge pull request #1891 from Kerrick/remove-reliance-on-global-ds

Import InvalidError instead of looking at global DS