BigPizzaV3/CodexPlusPlus · error

导出结果不完整

Error message

导出结果不完整

What it means

downloadMarkdownFallback() is the anchor-download path used when the File System Access API is unavailable. It validates its inputs first: a non-empty filename and a string markdown body are required to build the Blob and trigger the download; otherwise it throws "导出结果不完整".

Solutions

  1. Ensure the markdown is fully generated (await the export/render step) before calling the fallback.
  2. Validate filename and markdown type at the call site and show a user-facing "nothing to export" message.
  3. Fix callers that pass (filename, {markdown}) instead of (filename, markdown).
  4. Guard with `if (!markdown) return` upstream instead of letting the fallback throw.

Example fix

// before
downloadMarkdownFallback(exportName, maybeMarkdown);
// after
if (typeof maybeMarkdown === "string" && maybeMarkdown.length && exportName) {
  downloadMarkdownFallback(exportName, maybeMarkdown);
} else {
  showToast("导出内容为空,无法下载");
}
Defensive patterns

Strategy: validation

Validate before calling

if (!filename || typeof markdown !== "string" || !markdown.trim()) { showToast("导出内容为空"); return; }

Type guard

function isExportReady(filename, markdown) { return typeof filename === "string" && filename.length > 0 && typeof markdown === "string"; }

Try / catch

try { downloadMarkdownFallback(filename, markdown); } catch (e) { if (e.message === "导出结果不完整") showToast("没有可导出的内容"); else throw e; }

Prevention

When it happens

Trigger: Calling downloadMarkdownFallback(filename, markdown) with filename === ""/null/undefined or markdown not a string (null/undefined/object) — typically when the export pipeline produced no content and the caller passed it through unguarded.

Common situations: Conversation export ran before the transcript finished loading (empty markdown); a refactor changed saveMarkdown's signature and callers pass an options object; clipboard/stream source returned null on failure.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/c7ac86f909dd470a. Report an issue: GitHub.

Appendix: source

Thrown at assets/inject/renderer-inject.js:6400

            httpStatus: 200,
            responseStatus: fallback.status || "",
          });
          return fallback;
        }
        sendCodexPlusDiagnostic("backend_status_bridge_and_http_failed", {
          path,
          errorName: error?.name || "",
          errorMessage: error?.message || String(error),
        });
        return fallback;
      }
      throw error;
    }
  }

  function downloadMarkdownFallback(filename, markdown) {
    if (!filename || typeof markdown !== "string") {
      throw new Error("导出结果不完整");
    }
    const blob = new Blob([markdown], { type: "text/markdown;charset=utf-8" });
    const url = URL.createObjectURL(blob);
    const anchor = document.createElement("a");
    anchor.href = url;
    anchor.download = filename;
    document.body.appendChild(anchor);
    anchor.click();
    anchor.remove();
    setTimeout(() => URL.revokeObjectURL(url), 1000);
  }

  async function saveMarkdown(filename, markdown) {
    if (!filename || typeof markdown !== "string") {
      throw new Error("导出结果不完整");
    }
    if (typeof window.showSaveFilePicker !== "function") {
      downloadMarkdownFallback(filename, markdown);

View on GitHub (pinned to b1ed92e5e4)