✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
📊 Dash 2.0 is Arriving. Register here.

Displaying Callback Errors to the Client

I’m looking for advice on the best way to display callback errors to the client when the web server times out or fails to respond.

We are using gunicorn server with a timeout which kills worker threads if they exceed X seconds. When the worker thread is killed the connection is forcibly closed before the callback completes. This is convenient as it prevents a handful of long callbacks from locking up all of the worker processes.

What happens:
Currently when a callback fails (due to timeout, but sometimes other reasons) the html element silently returns to its previous state after logging to the developer console. For something wrapped in a dcc.Loading object, this tends to look like the load succeeded, however the contents will be stale data or other output that doesn’t make sense.

Desired behavior:
Be able to define “on callback failure” what to display inside the dcc.Loading object or some other mechanism to alert the user that something went wrong.

Any advice is greatly appreciated.