siyuan-note/siyuan · error

response.statusText

Error message

response.statusText

What it means

In copyPNGByLink, the fetch of the image link completed but response.ok was false (non-2xx HTTP status), and the rejection carries the HTTP statusText. The remote or proxied image could not be downloaded for PNG clipboard conversion.

Source

Thrown at app/src/menus/util.ts:288

        if (blob.type === "image/png") {
            copyBlob(blob);
            return;
        }
        const objectURL = URL.createObjectURL(blob);
        const tempElement = document.createElement("img");
        tempElement.onload = () => {
            imageToPNGClipboard(tempElement);
            URL.revokeObjectURL(objectURL);
        };
        tempElement.onerror = () => {
            URL.revokeObjectURL(objectURL);
            showCopyError();
        };
        tempElement.src = objectURL;
    };
    fetch(link).then(async (response) => {
        if (!response.ok) {
            throw new Error(response.statusText);
        }
        blobToPNGClipboard(await response.blob());
    }).catch(() => {
        // fetch 失败时回退:以 CORS 模式加载后再导出(需目标服务器返回 ACAO)
        const tempElement = document.createElement("img");
        tempElement.crossOrigin = "anonymous";
        tempElement.onload = () => imageToPNGClipboard(tempElement);
        tempElement.onerror = showCopyError;
        tempElement.src = link;
    });
};

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Confirm the image URL is reachable and returns 2xx
  2. Check kernel network proxy settings if the link is remote
  3. Copy the image manually from the browser when the server blocks programmatic fetch
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/src/menus/util.ts:288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/ab890490f0fe5a84. Report an issue: GitHub.