Mintplex-Labs/anything-llm · error · Error

res.reason

Error message

res.reason

What it means

Frontend guard in DataConnector.github.branches: the backend responded with JSON where success is false, meaning the GitHub branch-list request was rejected server-side (bad repo, invalid token, upstream failure); res.reason carries the explanatory cause from the server.

Solutions

  1. Review the returned reason for the data connector failure.
  2. Verify the data connector configuration and credentials.
  3. Check the external service availability.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown when a data connector request returns a failure reason.

Common situations: Misconfigured connector, bad credentials, or external service error.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/1cc1429694298e19. Report an issue: GitHub.

Appendix: source

Thrown at frontend/src/models/dataConnector.js:16

import { API_BASE } from "@/utils/constants";
import { baseHeaders } from "@/utils/request";
import showToast from "@/utils/toast";

const DataConnector = {
  github: {
    branches: async ({ repo, accessToken }) => {
      return await fetch(`${API_BASE}/ext/github/branches`, {
        method: "POST",
        headers: baseHeaders(),
        cache: "force-cache",
        body: JSON.stringify({ repo, accessToken }),
      })
        .then((res) => res.json())
        .then((res) => {
          if (!res.success) throw new Error(res.reason);
          return res.data;
        })
        .then((data) => {
          return { branches: data?.branches || [], error: null };
        })
        .catch((e) => {
          console.error(e);
          showToast(e.message, "error");
          return { branches: [], error: e.message };
        });
    },
    collect: async function ({ repo, accessToken, branch, ignorePaths = [] }) {
      return await fetch(`${API_BASE}/ext/github/repo`, {
        method: "POST",
        headers: baseHeaders(),
        body: JSON.stringify({ repo, accessToken, branch, ignorePaths }),
      })
        .then((res) => res.json())

View on GitHub (pinned to 3aec848f28)