hapi-fhir icon indicating copy to clipboard operation
hapi-fhir copied to clipboard

Error during stream handling

Open tadgh opened this issue 2 years ago • 0 comments

Transcribed:

It appears that when an exception occurs in HAPI while a response to a FHIR request is being streamed back to the client application, the handler for the exception ends up throwing another unhandled exception. The result is that rather than getting an Operation Outcome, the client application receives a message saying {{Problem: 500: STREAM}}.

Steps to Reproduce The triggers for this issue vary in the real production environment, but have been able to replicate similar behaviour by using an interceptor to throw an

  1. Create and compile an interceptor that throws an exception the first time Pointcut.SERVER_OUTGOING_WRITER_CREATED occurs for a given request. A sample interceptor class has been attached
  2. Load the interceptor
  3. Using a REST client (e.g. Postman or Insomnia) submit a generic GET request, e.g. GET /Patient, with a request header "Accept-Encoding" set to "gzip" (including this header will cause the response to be streamed to the client).

tadgh avatar Aug 04 '22 22:08 tadgh