· Jan 8, 2023

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
Discussion (5)1
Log in or sign up to continue

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>

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).