NCIOCPL / glossary-api

API for Dictionary of Cancer Terms, Dictionary of Genetics Terms, and other Glossary documents.
0 stars 5 forks source link

GetById returns status 500 for nonexistent IDs #161

Closed blairlearn closed 2 years ago

blairlearn commented 2 years ago

Issue description

When a glossary term is requested by ID, and no term matches that ID, the API returns an HTTP status 500 instead of 404.

This appears to be due to a change in the NEST client between versions 5.x and 7.x, whereby response.IsValid is now false when the term is not found.

As part of fixing this issue, it will be necessary to review the unit tests and verify that all methods are tested for appropriate behaviors when Elasticsearch returns a non-200 status.

ESTIMATE TBD

Steps to reproduce the issue

  1. Spin up the Docker containers in the integration-tests/docker-glossary-api directory.
  2. Browse to http://localhost:5000/Terms/cancer.gov/Patient/en/5 or use the swagger page to achieve the same.

What's the expected result?

What's the actual result?

Additional details / screenshot

Related Tickets

blairlearn commented 2 years ago

Fixed in fc16d09b04529138ec19ddda812634fa4478d5ba