---
title: "MTOfflineError | Mobile sdk | Mobile sdk ios | Ios"
description: "Represents errors that can occur during the offline planning and downloading process."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTOfflineError

```
public enum MTOfflineError : Error, LocalizedError, Sendable, Equatable
```

Represents errors that can occur during the offline planning and downloading process.

[](#/HTTP%20Failures)

### HTTP Failures

-   `[invalidURL(_:)](#/s:11MapTilerSDK14MTOfflineErrorO10invalidURLyACSScACmF)`
    
    The provided URL was invalid.
    
    #### Declaration
    
    Swift
    
    ```
    case invalidURL(String)
    ```
    
-   `[badResponse(statusCode:)](#/s:11MapTilerSDK14MTOfflineErrorO11badResponseyACSi_tcACmF)`
    
    The server returned a bad HTTP response with the given status code.
    
    #### Declaration
    
    Swift
    
    ```
    case badResponse(statusCode: Int)
    ```
    
-   `[networkError(_:)](#/s:11MapTilerSDK14MTOfflineErrorO07networkE0yAC10Foundation8URLErrorVcACmF)`
    
    A general network connectivity issue or URLSession error occurred.
    
    #### Declaration
    
    Swift
    
    ```
    case networkError(URLError)
    ```
    
-   `[noContent](#/s:11MapTilerSDK14MTOfflineErrorO9noContentyA2CmF)`
    
    The server returned a 204 No Content response, which is unexpected for this resource.
    
    #### Declaration
    
    Swift
    
    ```
    case noContent
    ```
    
-   `[contentMismatch(expected:actual:)](#/s:11MapTilerSDK14MTOfflineErrorO15contentMismatchyACSS_SStcACmF)`
    
    The received content format or type does not match the expected format.
    
    #### Declaration
    
    Swift
    
    ```
    case contentMismatch(expected: String, actual: String)
    ```
    

[](#/JSON%20Failures)

### JSON Failures

-   `[malformedJSON](#/s:11MapTilerSDK14MTOfflineErrorO13malformedJSONyA2CmF)`
    
    The JSON data is malformed or invalid.
    
    #### Declaration
    
    Swift
    
    ```
    case malformedJSON
    ```
    
-   `[missingKey(_:)](#/s:11MapTilerSDK14MTOfflineErrorO10missingKeyyACSScACmF)`
    
    A required key is missing in style.json or TileJSON.
    
    #### Declaration
    
    Swift
    
    ```
    case missingKey(String)
    ```
    
-   `[decodingError(_:)](#/s:11MapTilerSDK14MTOfflineErrorO08decodingE0yACs08DecodingE0OcACmF)`
    
    An error occurred while decoding JSON into a Swift type.
    
    #### Declaration
    
    Swift
    
    ```
    case decodingError(DecodingError)
    ```
    

[](#/Domain-Specific%20Cases)

### Domain-Specific Cases

-   `[invalidBoundingBox](#/s:11MapTilerSDK14MTOfflineErrorO18invalidBoundingBoxyA2CmF)`
    
    The provided bounding box is invalid.
    
    #### Declaration
    
    Swift
    
    ```
    case invalidBoundingBox
    ```
    
-   `[reversedZoomLevels(minZoom:maxZoom:)](#/s:11MapTilerSDK14MTOfflineErrorO18reversedZoomLevelsyACSd_SdtcACmF)`
    
    The minimum zoom level is greater than the maximum zoom level.
    
    #### Declaration
    
    Swift
    
    ```
    case reversedZoomLevels(minZoom: Double, maxZoom: Double)
    ```
    
-   `[missingAPIKey](#/s:11MapTilerSDK14MTOfflineErrorO13missingAPIKeyyA2CmF)`
    
    The API key is missing.
    
    #### Declaration
    
    Swift
    
    ```
    case missingAPIKey
    ```
    

[](#/Storage%20and%20Limitations)

### Storage and Limitations

-   `[insufficientStorage](#/s:11MapTilerSDK14MTOfflineErrorO19insufficientStorageyA2CmF)`
    
    The device does not have enough available storage space to complete the download.
    
    #### Declaration
    
    Swift
    
    ```
    case insufficientStorage
    ```
    
-   `[exceedsMaximumTileCount(limit:requested:)](#/s:11MapTilerSDK14MTOfflineErrorO23exceedsMaximumTileCountyACSi_SitcACmF)`
    
    The requested offline region exceeds the maximum allowed tile count or size.
    
    #### Declaration
    
    Swift
    
    ```
    case exceedsMaximumTileCount(limit: Int, requested: Int)
    ```
    
-   `[fileSystemError(_:)](#/s:11MapTilerSDK14MTOfflineErrorO010fileSystemE0yACSScACmF)`
    
    A file system error occurred while attempting to save or read offline data.
    
    #### Declaration
    
    Swift
    
    ```
    case fileSystemError(String)
    ```
    
-   `[invalidRegion](#/s:11MapTilerSDK14MTOfflineErrorO13invalidRegionyA2CmF)`
    
    The requested offline region resulted in no tiles. This typically happens when the area is too small for the selected zoom level.
    
    #### Declaration
    
    Swift
    
    ```
    case invalidRegion
    ```
    
-   `[cancelled](#/s:11MapTilerSDK14MTOfflineErrorO9cancelledyA2CmF)`
    
    The offline download or operation was cancelled by the user or system.
    
    #### Declaration
    
    Swift
    
    ```
    case cancelled
    ```
    
-   `[errorDescription](#/s:10Foundation14LocalizedErrorP16errorDescriptionSSSgvp)`
    
    #### Declaration
    
    Swift
    
    ```
    public var errorDescription: String? { get }
    ```
    
-   `[recoverySuggestion](#/s:10Foundation14LocalizedErrorP18recoverySuggestionSSSgvp)`
    
    #### Declaration
    
    Swift
    
    ```
    public var recoverySuggestion: String? { get }
    ```
    
-   `[==(_:_:)](#/s:SQ2eeoiySbx_xtFZ)`
    
    #### Declaration
    
    Swift
    
    ```
    public static func == (lhs: MTOfflineError, rhs: MTOfflineError) -> Bool
    ```
