ComposioHQ/composio · info · ComposioRequestCancelledError

Request was cancelled by the caller

Error message

Request was cancelled by the caller

What it means

Thrown by withCancellation when the caller-provided AbortSignal was aborted and the underlying fetch failed with an abort error. It wraps the abort into ComposioRequestCancelledError so callers can distinguish intentional cancellation from real network failures.

Source

Thrown at ts/packages/core/src/utils/cancellation.ts:16

import { ComposioRequestCancelledError, isRequestAbortError } from '../errors/SDKErrors';

/** @internal */
export async function withCancellation<T>(
  call: () => Promise<T>,
  signal?: AbortSignal
): Promise<T> {
  try {
    return await call();
  } catch (error) {
    if (signal?.aborted && isRequestAbortError(error)) {
      const underlyingMessage = error instanceof Error ? error.message : '';
      const message = underlyingMessage
        ? `Request was cancelled by the caller: ${underlyingMessage}`
        : 'Request was cancelled by the caller';
      throw new ComposioRequestCancelledError(message, {
        cause: error instanceof Error ? error : undefined,
      });
    }
    throw error;
  }
}

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Treat this error as expected: check e.name === 'ComposioRequestCancelledError' (or instanceof) and skip retry logic.
  2. If it fires unexpectedly, ensure you are not aborting the controller before the awaited call completes (double-abort or premature cleanup).
  3. For timeouts, consider retry with backoff instead of propagating cancellation.

Example fix

// before
const res = await composio.requests.response(id, { signal });
// after
try {
  const res = await composio.requests.response(id, { signal });
} catch (e) {
  if (e instanceof ComposioRequestCancelledError) return; // intentional cancel
  throw e;
}
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Passing an AbortSignal to a request method (response, result, update, delete, updateStatus, enable) and calling signal.abort() (or aborting a controller on timeout) while the HTTP request is in flight.

Common situations: Timeouts implemented with AbortController.timeout(), UI cancel buttons, racing requests, or shared controllers aborted too early (e.g. React StrictMode double-effect aborting on mount).

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/924f95eff0b3b200. Report an issue: GitHub.