# 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>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></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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
