{"record":{"id":"22eeb45054aefb02","repo":"denoland/deno","slug":"queue-already-closed","errorCode":null,"errorMessage":"Queue already closed","messagePattern":"Queue already closed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ext/kv/01_db.ts","lineNumber":327,"sourceCode":"      [],\n      [\n        [\n          core.serialize(message, { forStorage: true }),\n          opts?.delay ?? 0,\n          opts?.keysIfUndelivered ?? [],\n          opts?.backoffSchedule ?? null,\n        ],\n      ],\n    );\n    if (versionstamp === null) throw new TypeError(\"Failed to enqueue value\");\n    return { ok: true, versionstamp };\n  }\n\n  async listenQueue(\n    handler: (message: unknown) => Promise<void> | void,\n  ): Promise<void> {\n    if (this.#isClosed) {\n      throw new Error(\"Queue already closed\");\n    }\n    const finishMessageOps = new SafeMap<number, Promise<void>>();\n    while (true) {\n      // Wait for the next message.\n      const next: { 0: Uint8Array; 1: number } =\n        await op_kv_dequeue_next_message(\n          this.#rid,\n        );\n      if (next === null) {\n        break;\n      }\n\n      // Deserialize the payload.\n      const { 0: payload, 1: handleId } = next;\n      const deserializedPayload = core.deserialize(payload, {\n        forStorage: true,\n        deserializers: cloneableDeserializers,\n      });","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/kv/01_db.ts#L309-L345","documentation":"Error \"Queue already closed\" thrown in denoland/deno.","triggerScenarios":"Thrown at ext/kv/01_db.ts:327 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}