---
title: "What does StoreKitError.networkError mean?"
description: "StoreKitError.networkError wraps the URLError behind a failed StoreKit 2 request. Read the URLError code, retry once the connection returns, and see how the SDK maps it."
url: https://revenuedot.app/docs/errors/storekit-error-network-error
---

# What does StoreKitError.networkError mean?

StoreKitError.networkError means a StoreKit 2 request could not finish because of a network problem, and it carries the underlying `URLError`.

## Quick facts

| | |
|---|---|
| Error | `StoreKitError.networkError(URLError)` |
| Where | StoreKit 2, Swift (`StoreKitError`) |
| Available since | iOS 15.0, iPadOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, visionOS 1.0 |
| What the vendor says | A network error occurred. |

## Cause

- A StoreKit 2 request to the App Store failed at the network layer. The case carries a `URLError`, so the real reason (offline, timeout, lost connection) is in its `code`.
- Apple's documentation for the case is one line. The reason is not in the case name; it is in the associated `URLError`.
- The error comes from the device or its connection, not from your app's product configuration.

## Fix

1. Read `urlError.code` first. `.notConnectedToInternet` means the device is offline; `.timedOut` and `.networkConnectionLost` are usually temporary.
2. Retry the action after a short pause, or when the connection returns. Do not retry in a tight loop.
3. Show a message such as "Check your connection and try again" and keep the paywall open.
4. Do not unlock content because of this error. Unlock from verified transactions only.

## Example

```swift
import StoreKit

// A purchase that fails on the network is safe to offer again: nothing was bought.
func buy(_ product: Product) async {
    do {
        let result = try await product.purchase()
        print("Purchase result: \(result)")
    } catch StoreKitError.networkError(let urlError) {
        // The URLError code says why: offline, timeout, lost connection.
        print("Network problem (\(urlError.code.rawValue)); ask the person to try again")
    } catch {
        print("Purchase failed: \(error)")
    }
}
```

*Compile-checked: `npm run check:snippets` type-checks this snippet with `swiftc` against the Apple SDK (macOS target, checked 2026-10-03).*

## How the RevenueDot SDK reports it

The RevenueDot `purchases-ios` fork maps `StoreKitError.networkError` to `ErrorCode.networkError` (code 10) and passes the `URLError` along as the underlying error. A device that is offline surfaces as `offlineConnectionError` (code 35) when the SDK's own request fails the same way. See [what networkError means in the SDK](https://revenuedot.app/docs/errors/sdk-network-error.md).

## Related

- [What does networkError (code 10) mean in the purchases SDK?](https://revenuedot.app/docs/errors/sdk-network-error.md)
- [What does offlineConnectionError (code 35) mean in the purchases SDK?](https://revenuedot.app/docs/errors/sdk-offline-connection-error.md)
- [What does Play Billing NETWORK_ERROR (12) mean?](https://revenuedot.app/docs/errors/play-billing-network-error.md)

## Source

- [Apple: StoreKitError.networkError(_:)](https://developer.apple.com/documentation/storekit/storekiterror/networkerror%28_:%29)
- [Apple: URLError](https://developer.apple.com/documentation/foundation/urlerror)
- [RevenueDot purchases-ios: StoreKitError+Extensions.swift (how the SDK maps StoreKit 2 errors)](https://github.com/revenuedot/purchases-ios/blob/revenuedot/main-patches/Sources/Error%20Handling/StoreKitError%2BExtensions.swift)

Checked: 2026-10-03
