AtlasOfLivingAustralia / biocache-service

Occurrence & mapping webservices
https://biocache-ws.ala.org.au/ws/
Other
9 stars 26 forks source link

Do not catch Solr exception and convert it normal result. We already … #685

Closed alexhuang091 closed 3 years ago

alexhuang091 commented 3 years ago

…have a customExceptionResolver which can set HTTP status code according to Solr error type.

for issue 522 https://github.com/AtlasOfLivingAustralia/biocache-service/issues/522

So now the response will like these:

Screen Shot 2021-08-20 at 11 31 12 am Screen Shot 2021-08-20 at 11 31 50 am

Removing the try {} catch makes the function possibly throw QidMissingException. It is also handled
Before the change if a qid is not found, it's like this

Screen Shot 2021-08-20 at 12 07 51 pm

Now after the change it's like

Screen Shot 2021-08-20 at 11 20 43 am Screen Shot 2021-08-20 at 11 21 13 am
nickdos commented 3 years ago

@brucehyslop could you code review this please?

coveralls commented 3 years ago

Coverage Status

Coverage increased (+2.4%) to 45.447% when pulling c25ebc25f57a75cde8841d26fdad1d740a5c38e3 on issue_522_statuscode_200_when_solr_error_happens into f4eb2ec4e208914008a4cb040c68b3d43e024f92 on develop.