Dmitrii Baranov · Jan 8

FHIR CustomBuiltinOperations - handling error 500 in production


I've overrided the HS.FHIRServer.Storage.BuiltInOperations class, and generally all works fine except of error handling. Where can I find a server setting option to ask IRIS to return OperationOutcome if an Internal Server Error occurs? Currently it returns non-informative HTML instead of JSON/OperationOutcome.

Product version: IRIS 2022.3
0 106
Discussion (5)2
Log in or sign up to continue

Are you setting Accept header in request to application/json?

I'm using Postman, the default Accept header value was */*, then according your advice I tried application/json, then application/fhir+json, both not working, IRIS still produces HTML

<div id="content">
        <div class="content-container">
                <h2>500 - Internal server error.</h2>
                <h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>

Thanks, I caught your idea but no, IIS is not a cause, although the issue exists in Windows but not in Linux

Dmitry, following up on @Eduard Lebedyuk's comment, and even though you seem to say IIS is not the cause, this does "smell" like an IIS-related configuration.

I suggest you look here in the IIS docs, and in this related thread.

This setting enables to provide custom error pages instead of the "raw" downstream original server error (to be friendlier to users, or to possibly hide sensitive error details).

Try turning this setting off and see if this helps (if Apache is also available for example you can attempt testing with it as well to compare results).