> For the complete documentation index, see [llms.txt](https://docs.onside.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onside.io/sdk/reference/errors.md).

# Error Reference

OnsideKit reports failures with small typed enums. Switch over the cases — they are not `LocalizedError`, so `localizedDescription` is generic.

## Common causes

Many cases share a meaning across error types:

<table><thead><tr><th width="260">Case</th><th>Meaning</th></tr></thead><tbody><tr><td><code>loginDiscarded</code></td><td>The user dismissed a required login screen.</td></tr><tr><td><code>cancelled</code></td><td>The operation was cancelled (by the user or <code>stop()</code>).</td></tr><tr><td><code>presentationFailed</code></td><td>OnsideKit couldn't present the purchase UI — no active window scene was available (e.g. the app was backgrounded). The purchase never started; retry once the app is in the foreground.</td></tr><tr><td><code>connectionError</code></td><td>Network failure — usually retryable.</td></tr><tr><td><code>serviceUnavailable</code></td><td>Server returned 5xx — retry later.</td></tr><tr><td><code>appNotRegistered</code></td><td>The app/install isn't recognized by Onside (HTTP 404) — check your app registration/configuration.</td></tr><tr><td><code>invalidProductIdentifier</code></td><td>The products request was rejected (HTTP 422).</td></tr><tr><td><code>internalError</code></td><td>Parsing or other unexpected error.</td></tr><tr><td><code>notLoggedIn</code></td><td>The operation requires an authenticated user.</td></tr><tr><td><code>notSupportedInLocalTesting</code></td><td>Unavailable while running with a <code>.storekit</code> configuration.</td></tr></tbody></table>

## Errors by type

<table><thead><tr><th width="360">Error type</th><th>Cases</th></tr></thead><tbody><tr><td><code>OnsideLoginError</code></td><td><code>loginDiscarded</code></td></tr><tr><td><code>OnsideProductsRequestError</code></td><td><code>cancelled</code>, <code>connectionError</code>, <code>appNotRegistered</code>, <code>invalidProductIdentifier</code>, <code>serviceUnavailable</code>, <code>internalError</code></td></tr><tr><td><code>OnsideSignedInAppsHistoryRequestError</code></td><td><code>notLoggedIn</code>, <code>notSupportedInLocalTesting</code>, <code>cancelled</code>, <code>connectionError</code>, <code>appNotRegistered</code>, <code>serviceUnavailable</code>, <code>internalError</code></td></tr><tr><td><code>OnsidePaymentMethodsManagerError</code></td><td><code>loginDiscarded</code>, <code>notSupportedInLocalTesting</code></td></tr><tr><td><code>OnsidePaymentQueueAddProductError</code></td><td><code>loginDiscarded</code></td></tr><tr><td><code>OnsidePaymentQueueRequestRestoreError</code></td><td><code>loginDiscarded</code></td></tr><tr><td><code>OnsidePaymentTransactionError</code></td><td><code>cancelled</code>, <code>presentationFailed</code></td></tr><tr><td><code>OnsideTransactionsRestoreError</code></td><td><code>cancelled</code>, <code>connectionError</code>, <code>appNotRegistered</code>, <code>serviceUnavailable</code>, <code>internalError</code></td></tr><tr><td><code>OnsideAttributionMetadataError</code></td><td><code>connectionError</code>, <code>appNotRegistered</code>, <code>serviceUnavailable</code>, <code>internalError</code></td></tr></tbody></table>

## Where each is delivered

* `OnsideLoginError` — `Onside.requestLogin(completion:)`
* `OnsideProductsRequestError` — `OnsideProductsRequestDelegate.onsideProductsRequest(_:didFailWithError:)`
* `OnsideSignedInAppsHistoryRequestError` — `Onside.makeSignedInAppsHistoryRequest()` result and its request delegate
* `OnsidePaymentMethodsManagerError` — `Onside.presentPaymentMethodsManager(completion:)`
* `OnsidePaymentQueueAddProductError` — `OnsidePaymentQueue.add(_:completion:)`
* `OnsidePaymentQueueRequestRestoreError` — `OnsidePaymentQueue.restoreCompletedTransactions(completion:)` (pre-flight)
* `OnsidePaymentTransactionError` — `OnsidePaymentTransaction.error` on a `.failed` transaction
* `OnsideTransactionsRestoreError` — `onsidePaymentQueue(_:restoreCompletedTransactionsFailedWithError:)`
* `OnsideAttributionMetadataError` — `Onside.getAttributionMetadata(completion:)`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.onside.io/sdk/reference/errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
