Search should gracefully handle non 200-OK responses from policy service
Request:
After !290 (merged) I would like to see an enhancement to search. If the policy service delivers anything other than a HTTP_200_OK response, that search handles this and fail gracefully. Currently it will deliver a failed message to elastic search and this is far from optimal.
Related background:
Policy Service currently handles a special use-case with translate API, if the policy-id is not found it returns {"query": {"match_none": {}}} instead of a HTTP_404_NOT_FOUND. But search should handle all the other use-cases, for example when Policy service is not available (or OPA is not available) - i.e. a HTTP_500_INTERNAL_SERVER_ERROR. This feature was added as a result of osdu/platform/security-and-compliance/policy#72 (closed)