hapi-fhir
hapi-fhir copied to clipboard
Error during stream handling
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
- 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
- Load the interceptor
- 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).