Added support for custom validation functions to throw errors (with error messages) or default objects with overrides of the default custom validation error message.