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

Improve error title for error code 422 ("Unprocessable Entity") in partial search #60

Closed
TheRedTrainer opened this issue Sep 19, 2017 · 4 comments

Comments

@TheRedTrainer
Copy link

TheRedTrainer commented Sep 19, 2017

If the rdap server has the "allow_search_wildcars_anywhere" property (in configuration.properties) turned off and a client executes a partial search like

http://localhost:8080/rdap-server/domains?nsLdhName=*test*

The following error message is displayed:

{"rdapConformance":["rdap_level_0"],"errorCode":"422","title":"Unprocessable Entity","description":"Partial search can only have wildcards at the end of each label"}

However, this message could be confusing because the standard title for error code 422 mentions an "unprocessable entity", so it could be confused with the rdap entity object when a client is searching for a domain.

@pcarana pcarana added this to the v1.1.3 milestone Sep 26, 2017
@pcarana
Copy link
Contributor

pcarana commented Sep 30, 2017

The default title is now "Unprocessable HTTP Entity" to avoid confusion. The issue was at NICMx/rdap-data-access-api, still will be solved here.

@TheRedTrainer
Copy link
Author

Reopen (bug). When a 422 error code is returned from server, the title keep showing the text "Unprocessable entity".

{"rdapConformance":["rdap_level_0"],"errorCode":"422","title":"Unprocessable Entity","description":"Search pattern must be at least 5 characters, consecutive wildcards '*' are treated as only one character. Pattern received: *"}

This is probably caused because the DEFAULT_MSG in UnprocessableEntityException class (in the solution) is not used when the exception is created.

@pcarana
Copy link
Contributor

pcarana commented Oct 4, 2017

Yep, the solution was incomplete. The title was set at ExceptionResult, the real fix was to update the title of the error at that class; please, try again.

@TheRedTrainer
Copy link
Author

TheRedTrainer commented Oct 4, 2017

Verified. If an user perform a search that returns a 422 error code, the error message is displayed with the new title. For example

{"rdapConformance":["rdap_level_0"],"errorCode":"422","title":"Unprocessable HTTP Entity","description":"Partial search can only have one wildcard at each label"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants