add missing error constants

Noticed these errors weren't actually defined, so I added them. Added a test as well.