Moved the check for a custom error message entirely to the ValidationException.