async def METHOD_NAME(mock_format_exc: MagicMock) -> None:
    receive = AsyncMock()
    receive.return_value = {"type": "lifespan.shutdown"}
    send = AsyncMock()
    exception = ValueError("foo")
    mock_format_exc.return_value = str(exception)
    mock_on_shutdown = AsyncMock(side_effect=exception)
    async def on_shutdown() -> None:
        await mock_on_shutdown()
    router = ASGIRouter(app=Litestar(on_shutdown=[on_shutdown]))
    with pytest.raises(ValueError):
        await router.lifespan(receive, send)
    assert send.call_count == 2
    assert send.call_args_list[1][0][0] == {"type": "lifespan.shutdown.failed", "message": mock_format_exc.return_value}