Implement custom validation error

Fixes #78