Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect validation exception messages in QueryValidator #844

Closed
shils opened this issue Sep 6, 2015 · 1 comment
Closed

Incorrect validation exception messages in QueryValidator #844

shils opened this issue Sep 6, 2015 · 1 comment
Labels
Milestone

Comments

@shils
Copy link
Contributor

shils commented Sep 6, 2015

In QueryValidator's validateQuery method, when a mapped field is not found for a given part, the exception message refers to the original class being mapped rather than the class being used to look up the field:

if (mf == null) {                                                                                              
    throw new ValidationException(format("The field '%s' could not be found in '%s' while validating - %s; if "
                                         + "you wish to continue please disable validation.", part,            
                                         clazz.getName(), prop                                                 
                                        ));                                                                    
}                                                                                                              

Further along, when checking for queries into @Reference or @Serialized fields, the exception message is:

format("Can not use dot-notation past '%s' could not be found in '%s' while"
       + " validating - %s", part, clazz.getName(), prop))

which looks like a copy-paste typo.

I have a branch off of master on my fork which fixes these issues; should I create a pull request?

@evanchooly
Copy link
Member

please do. thanks.

shils added a commit to shils/morphia that referenced this issue Sep 9, 2015
shils added a commit to shils/morphia that referenced this issue Sep 9, 2015
evanchooly added a commit that referenced this issue Sep 15, 2015
correct query validation exception messages fixes #844
@evanchooly evanchooly added the bug label Sep 15, 2015
@evanchooly evanchooly added this to the 1.1.0 milestone Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants