> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# AuxiliaryLegCancelledError

> Thrown when an auxiliary leg is removed before it finishes connecting.

The application stopped a screen share or removed an additional input device while its leg was still connecting. It is not a failure — the app got what it asked for — but it is typed rather than silently resolved so a caller awaiting the start can tell a cancel apart from a share that actually came up. The public start methods return `void`, so the rejection is the only signal they have.

## **Extends**

* `Error`

## **Constructors**

### Constructor

```ts
new AuxiliaryLegCancelledError(leg): AuxiliaryLegCancelledError
```

### Parameters

**`leg`** `'main' | 'screenshare' | 'additional-device'` — required

Which auxiliary leg was removed, e.g. `'screenshare'`.

---

## **Properties**

**`leg`** `'main' | 'screenshare' | 'additional-device'` — required

Read-only. Which auxiliary leg was removed.

---

## **Examples**

```ts
import { AuxiliaryLegCancelledError } from '@signalwire/js';

try {
  await call.self.startScreenShare();
  toast('Sharing your screen');
} catch (error) {
  if (error instanceof AuxiliaryLegCancelledError) {
    // The app called stopScreenShare() while the leg was connecting — nothing to report.
    return;
  }
  throw error;
}
```

## **See**

* [`AuxiliaryLegTimeoutError`](/docs/browser-sdk/v4/reference/errors/auxiliary-leg-timeout-error) — the leg never connected in time.
* [`startScreenShare`](/docs/browser-sdk/v4/reference/self-participant/start-screen-share).