How are timeouts surfaced in the rest API?

I see the /operations/wait endpoint supports a timeout param:

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": [
		"instances": [
	"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.

Thanks for the help.