How are timeouts surfaced in the rest API?

I see the /operations/wait endpoint supports a timeout param:
https://linuxcontainers.org/lxd/docs/master/rest-api#10operationsuuidwait

But it’s not clear to me how that timeout gets surfaced at the api level when it expires.

A cursory scan of the code shows that the timeout expiring causes this waitFinal method to return false:

But I think it gets ignored by the caller:

Anyone know how to detect whether a timeout expired without the operation completing?

stgraber@castiana:~$ lxc query /1.0/operations/014b8909-5cec-4b73-903f-7b231fc4657d/wait?timeout=2
{
	"class": "task",
	"created_at": "2020-03-19T15:32:42.329637042-04:00",
	"description": "Creating container",
	"err": "",
	"id": "014b8909-5cec-4b73-903f-7b231fc4657d",
	"location": "none",
	"may_cancel": true,
	"metadata": {
		"download_progress": "rootfs: 51% (9.81MB/s)"
	},
	"resources": {
		"containers": [
			"/1.0/containers/blah"
		],
		"instances": [
			"/1.0/instances/blah"
		]
	},
	"status": "Running",
	"status_code": 103,
	"updated_at": "2020-03-19T15:32:55.088357752-04:00"
}

In this example, the timeout was hit and so you get the current operation state, which indicates it’s in fact still running per status and status_code.

Okay gotcha, so a 103 status code means the operation is still in progress.
https://linuxcontainers.org/lxd/docs/master/rest-api#status-codes

Thanks for the help.