<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS/CancellablePromise/catch",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CKTool JS"
    ],
    "preciseIdentifier" : "instm/CancellablePromise/catch"
  },
  "title" : "catch"
}
-->

# catch

Tells `CancellablePromise` what callback to call on failure of the inner promise.

```
CancellablePromise catch(
	Function? onrejected
);
```

## Parameters

`onrejected`

An optional function `CancellablePromise` calls when the inner promise rejects.

## Discussion

If you provide a function for the `onrejected` parameter, `CancellablePromise` calls that function if the promise fails.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)