<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.0.0",
    "iPadOS: 14.0.0 - 17.0.0",
    "macCatalyst: 14.0.0 - 17.0.0",
    "macOS: 11.0.0 - 14.0.0",
    "tvOS: 14.0.0 - 17.0.0",
    "watchOS: 7.0.0 - 10.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest/SKTestSession/failureError",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTestSession(py)failureError"
  },
  "title" : "failureError"
}
-->

# failureError

The error code that transactions return when you enable failing transactions.

```
var failureError: SKError.Code { get set }
```

## Discussion

You can force an error by setting [`failTransactionsEnabled`](/documentation/StoreKitTest/SKTestSession/failTransactionsEnabled) to `true` and setting [`failureError`](/documentation/StoreKitTest/SKTestSession/failureError) value to one of these supported error codes: <doc://com.apple.documentation/documentation/StoreKit/SKError/Code/unknown>, <doc://com.apple.documentation/documentation/StoreKit/SKError/Code/invalidOfferIdentifier>, <doc://com.apple.documentation/documentation/StoreKit/SKError/Code/invalidSignature>, <doc://com.apple.documentation/documentation/StoreKit/SKError/Code/missingOfferParams>, <doc://com.apple.documentation/documentation/StoreKit/SKError/Code/invalidOfferPrice>.

Use these settings to test your how your app responds to failed transactions.

---

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)