iflytek/astron-agent · error · Error

space.queryFailed

Error message

space.queryFailed

What it means

The space table loader throws 'space.queryFailed' when the list/query API returns a response that is not successful (result.success falsy), after which onError is invoked. It signals the paged space listing could not be fetched.

Solutions

  1. Check the browser network tab for the actual API status/error body.
  2. Re-authenticate if the token expired (401/403).
  3. Verify the space backend service is healthy.
  4. Confirm query parameters (pagination/filters) are valid for the API.

Example fix

// before
} else {
  throw new Error(t('space.queryFailed'));
}
// after
} else {
  console.error('space query failed', result);
  throw new Error(result?.message ?? t('space.queryFailed'));
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!res.ok || !res.data?.success) throw new Error(res.data?.message ?? 'query failed');

Try / catch

try {
  await loadSpaces();
} catch (e) {
  onError?.(e);
  message.error(t('space.queryFailed'));
}

Prevention

When it happens

Trigger: fetchSpaces/list API returns success=false (backend error, auth expiry, service unavailable) while the table is loading or paginating.

Common situations: Session token expired, tenant/space service down, backend returning an error envelope the table code treats as failure, network proxy errors.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/4723a97264b47ac6. Report an issue: GitHub.

Appendix: source

Thrown at console/frontend/src/components/space/space-table/index.tsx:178

      try {
        const params: QueryParams = {
          current: paginationParams?.current || pagination.current,
          pageSize: paginationParams?.pageSize || pagination.pageSize,
          ...extraParams,
        };

        const result = await queryData(params);
        if (result.success !== false) {
          setData(result.data);
          setPagination(prev => ({
            ...prev,
            total: result.total,
            ...(paginationParams || {}),
          }));

          onSuccess?.(result.data, result.total);
        } else {
          throw new Error(t('space.queryFailed'));
        }
      } catch (error) {
        onError?.(error);
      } finally {
        setLoading(false);
      }
    },
    [
      extraParams,
      queryData,
      onSuccess,
      onError,
      pagination.current,
      pagination.pageSize,
      t,
    ]
  );

View on GitHub (pinned to 5e758547a8)