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

invalid sort parameter value leads to 500 server error #3274

Closed
lmsurpre opened this issue Feb 3, 2022 · 1 comment
Closed

invalid sort parameter value leads to 500 server error #3274

lmsurpre opened this issue Feb 3, 2022 · 1 comment
Assignees
Labels
bug Something isn't working P3 Priority 3 - Nice To Have

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Feb 3, 2022

Describe the bug
invalid sort parameter value leads to 500 Sever Error but should be 400 Bad Request

Caused by: java.lang.IllegalArgumentException: Invalid sortValue: -lastUpdated
	at com.ibm.fhir.persistence.HistorySortOrder.of(HistorySortOrder.java:61)
	at com.ibm.fhir.persistence.util.FHIRPersistenceUtil.parseSystemHistoryParameters(FHIRPersistenceUtil.java:186)
	... 65 more

Environment
main

To Reproduce
invoke whole-system history with a bogus sort value; for example
{{base}}/_history?_sort=bogus

Expected behavior
it should be a 400 Bad Request, not a 500.

Additional context
missed this in the description and QA for #2026

@lmsurpre lmsurpre added bug Something isn't working P3 Priority 3 - Nice To Have labels Feb 3, 2022
prb112 added a commit that referenced this issue Feb 10, 2022
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
@prb112 prb112 self-assigned this Feb 10, 2022
prb112 added a commit that referenced this issue Feb 10, 2022
* invalid sort parameter value leads to 500 server error #3274

Signed-off-by: Paul Bastide <pbastide@us.ibm.com>

* Per Code Review updating logging and messages

Signed-off-by: Paul Bastide <pbastide@us.ibm.com>

* Update persistence

Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
@d0roppe
Copy link
Collaborator

d0roppe commented Feb 13, 2022

verified that this error is now a code 400, also verified other errors with _history are also code 400

@d0roppe d0roppe closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 Priority 3 - Nice To Have
Projects
None yet
Development

No branches or pull requests

3 participants