INNER CODE UNIT · JavaScript

timer

EdgeTypE/better-deepseek · src/background/index.js:657

  const timer = ac ? setTimeout(() => ac.abort(new DOMException("MCP server did not respond within 30s", "TimeoutError")), MCP_REQUEST_TIMEOUT_MS) : null;
  try {
    const resp = await fetch(serverUrl, {
      method: "POST",
      headers: mcpHeaders(apiKey, sessionId, authMethod),
      body: JSON.stringify(bodyObj),
      signal: resolvedSignal,
    });
    if (!resp.ok) {
      let detail = "";
      try { detail = await resp.text(); } catch (e) { }
      throw Object.assign(
        new Error(`MCP server returned ${resp.status}${detail ? ": " + detail.slice(0, 300) : ""}`),
        { status: resp.status },
      );
    }

    const responseSessionId = resp.headers.get("Mcp-Session-Id") || null;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…