{"draft":null,"from":88,"to":89,"files":[{"path":"client/src/api.ts","added":14,"removed":3,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -439,6 +439,17 @@\n \t\treturn this.json(method, path, body, this.issuesServer);\n \t}\n \n+\t/** An ask-thread call, with a server from before ask threads named as that rather than a bare 404. */\n+\tasync #threads<T>(call: Promise<T>): Promise<T> {\n+\t\ttry {\n+\t\t\treturn await call;\n+\t\t} catch (err) {\n+\t\t\tif (err instanceof ApiError && err.status === 404 && /no such issues route/.test(err.message))\n+\t\t\t\tthrow new ApiError(`${this.config.server} doesn't have ask threads yet`, 404);\n+\t\t\tthrow err;\n+\t\t}\n+\t}\n+\n \t/** Issues, most recently updated first. */\n \tissues(\n \t\tq: { status?: string; agent?: string; parent?: number; open?: boolean; labels?: readonly string[] } = {},\n@@ -468,12 +479,12 @@\n \n \t/** The asks this agent sent: the open ones, then the latest answered, each with its thread. */\n \tasked(): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {\n-\t\treturn this.#issues(\"GET\", this.agentPath(\"asked\"));\n+\t\treturn this.#threads(this.#issues(\"GET\", this.agentPath(\"asked\")));\n \t}\n \n \t/** One ask, open or closed, with its thread and who it waits on. */\n \taskThread(id: number): Promise<{ ask: Ask & { title: string | null } }> {\n-\t\treturn this.#issues(\"GET\", `/ask/${id}`);\n+\t\treturn this.#threads(this.#issues(\"GET\", `/ask/${id}`));\n \t}\n \n \t/** Open asks of someone (an agent, or person:<id>), soonest due first; every open ask without `of`. */\n@@ -658,7 +669,7 @@\n \n \t/** Adds to an ask's thread, as its asker or the one asked; the other side hears it, and the ask stays as it is. */\n \treply(id: number, body: { text: string; question?: boolean }): Promise<{ ask: Ask; news?: IssueNews }> {\n-\t\treturn this.#issues(\"POST\", this.agentPath(`reply/${id}`), body);\n+\t\treturn this.#threads(this.#issues(\"POST\", this.agentPath(`reply/${id}`), body));\n \t}\n \n \t/** Takes back an ask this agent made, with a note on why; the one asked hears it. */"}],"unmatched":[]}