> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryrollup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RollupError

> Every error the Rollup SDK throws.

```swift theme={null}
public struct RollupError: Error, Codable, Sendable, Equatable, CustomStringConvertible
```

Every error the SDK throws: a stable `code` and a `message` meant for you, not for the person. Errors that came from Rollup's server also carry the server's own code.

<ResponseField name="code" type="Code">
  The error's code.
</ResponseField>

<ResponseField name="message" type="String">
  What happened. For a `server` error, it starts with the server's error code and HTTP status, such as `agent_unavailable (503): The agent is unavailable.` Other errors from the server carry its message as is, such as the reset date of `quotaExceeded`.
</ResponseField>

<ResponseField name="serverCode" type="String?">
  The server's error code, such as `app_disabled`, `rate_limited` or `invalid_schema`, for every error that came from Rollup's server. `nil` for errors raised on the iPhone.
</ResponseField>

<ResponseField name="retryable" type="Bool?">
  Whether the same call can succeed later unchanged, when the SDK or the server says. `true` for `rateLimited` and for Apple's App Attest service being unavailable; `false` for `quotaExceeded` and `appAttestFailed`.
</ResponseField>

<ResponseField name="retryAfter" type="Double?">
  Seconds to wait before retrying, when the server sends a `Retry-After` header.
</ResponseField>

<ResponseField name="description" type="String">
  The code and the message, as `code: message`.
</ResponseField>

## Codes

| Code | Meaning |
| - | - |
| `simulatorUnsupported` | The SDK is running in the iOS Simulator. It needs a real iPhone. |
| `notConfigured` | `configure` has not been called, or the key does not start with `rk_`. |
| `missingRequirement` | Your Info.plist lacks an entry the SDK needs. The message names each one. |
| `photoAccessDenied` | `search`, `query` or `profile` while Photos access is denied or restricted. Turning access off deletes the index, so there is nothing to read; the indexing state is `needsPhotoAccess`. Limited access is not denied. |
| `noIndex` | Nothing is indexed yet. |
| `assetsUnavailable` | The first-run models could not be downloaded. |
| `appAttestFailed` | App Attest could not vouch for this install, so the device could not register. Most often your target lacks the App Attest capability (`com.apple.developer.devicecheck.appattest-environment`); the message names the likely cause. Not retryable. |
| `rateLimited` | Too many requests in 5 minutes (429 `rate_limited`). Retryable; `retryAfter` says how long to wait when the server sends it. |
| `network` | The network failed, such as no connection or a timeout, or Apple's App Attest service was unavailable. Retryable. |
| `server` | Rollup's server refused the request for any other reason. `serverCode` holds the server's code. |
| `indexing` | An indexing run failed. |
| `cancelled` | The work was cancelled or stopped. |
| `invalidSchema` | The schema passed to `profile` is not a JSON object, or the server refused it (`invalid_schema`); the message names the first problem. |
| `accessRevoked` | Your app's key stopped working: unknown or past its grace period, the app disabled or revoked, or your account not approved. Indexing is stopped and the index locked. See [Keys and revocation](/guides/keys-and-revocation). |
| `appPendingApproval` | Your app is waiting for Rollup's approval. Search over an index already on the iPhone keeps working, and the SDK asks again at its next check. |
| `quotaExceeded` | Your app used its monthly token budget. `query` and `profile` fail until it resets; the message names the date. |
| `unknown` | Anything else. |

## Static errors

<ResponseField name="simulatorUnsupported" type="static let RollupError" />

<ResponseField name="notConfigured" type="static let RollupError" />

<ResponseField name="noIndex" type="static let RollupError" />

<ResponseField name="photoAccessDenied" type="static let RollupError" />

<ResponseField name="accessRevoked" type="static let RollupError" />

<ResponseField name="appPendingApproval" type="static let RollupError" />

Compare codes rather than whole errors, since messages can differ:

```swift theme={null}
catch let error as RollupError where error.code == .accessRevoked {
    // Show that the feature is unavailable.
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.