<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreLocation",
  "identifier" : "/documentation/CoreLocation/CLError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Location"
    ],
    "preciseIdentifier" : "c:@E@CLError"
  },
  "title" : "CLError.Code"
}
-->

# CLError.Code

Error codes returned by the location manager object.

```
enum Code
```

## Overview

Instances of <doc://com.apple.documentation/documentation/Foundation/NSError> object delivered to the delegate use these error codes for the <doc://com.apple.documentation/documentation/Foundation/NSError/code> property of the error object.

## Topics

### Getting general errors

[`CLError.Code.locationUnknown`](/documentation/CoreLocation/CLError-swift.struct/Code/locationUnknown)

A constant that indicates the location manager was unable to obtain a location value right now.

[`CLError.Code.denied`](/documentation/CoreLocation/CLError-swift.struct/Code/denied)

A constant that indicates the user denied access to the location service.

[`CLError.Code.promptDeclined`](/documentation/CoreLocation/CLError-swift.struct/Code/promptDeclined)

A constant that indicates the user didn’t grant the requested temporary authorization.

[`CLError.Code.network`](/documentation/CoreLocation/CLError-swift.struct/Code/network)

A constant that indicates the network was unavailable or a network error occurred.

[`CLError.Code.headingFailure`](/documentation/CoreLocation/CLError-swift.struct/Code/headingFailure)

A constant that indicates the location manager can’t determine the heading.

[`CLError.Code.rangingUnavailable`](/documentation/CoreLocation/CLError-swift.struct/Code/rangingUnavailable)

A constant that indicates ranging is disabled.

[`CLError.Code.rangingFailure`](/documentation/CoreLocation/CLError-swift.struct/Code/rangingFailure)

A constant that indicates a general ranging error occurred.

### Getting region monitoring errors

[`CLError.Code.regionMonitoringDenied`](/documentation/CoreLocation/CLError-swift.struct/Code/regionMonitoringDenied)

A constant that indicates the user denied access to the region monitoring service.

[`CLError.Code.regionMonitoringFailure`](/documentation/CoreLocation/CLError-swift.struct/Code/regionMonitoringFailure)

A constant that indicates the location manager failed to monitor a registered region.

[`CLError.Code.regionMonitoringSetupDelayed`](/documentation/CoreLocation/CLError-swift.struct/Code/regionMonitoringSetupDelayed)

A constant that indicates Core Location failed to initialize the region monitoring feature.

[`CLError.Code.regionMonitoringResponseDelayed`](/documentation/CoreLocation/CLError-swift.struct/Code/regionMonitoringResponseDelayed)

A constant that indicates Core Location will deliver events but they may be delayed.

### Getting geocoding errors

[`CLError.Code.geocodeCanceled`](/documentation/CoreLocation/CLError-swift.struct/Code/geocodeCanceled)

A constant that indicates the geocode request was canceled.

[`CLError.Code.geocodeFoundNoResult`](/documentation/CoreLocation/CLError-swift.struct/Code/geocodeFoundNoResult)

A constant that indicates the geocode request yielded no result.

[`CLError.Code.geocodeFoundPartialResult`](/documentation/CoreLocation/CLError-swift.struct/Code/geocodeFoundPartialResult)

A constant that indicates the geocode request yielded a partial result.

### Getting deferred location update errors

[`CLError.Code.deferredFailed`](/documentation/CoreLocation/CLError-swift.struct/Code/deferredFailed)

A constant that indicates the location manager didn’t enter deferred mode for an unknown reason.

[`CLError.Code.deferredCanceled`](/documentation/CoreLocation/CLError-swift.struct/Code/deferredCanceled)

A constant that indicates your app or the location manager canceled the request for deferred updates.

[`CLError.Code.deferredAccuracyTooLow`](/documentation/CoreLocation/CLError-swift.struct/Code/deferredAccuracyTooLow)

A constant that indicates deferred mode isn’t supported for the requested accuracy.

[`CLError.Code.deferredDistanceFiltered`](/documentation/CoreLocation/CLError-swift.struct/Code/deferredDistanceFiltered)

A constant that indicates deferred mode doesn’t support distance filters.

[`CLError.Code.deferredNotUpdatingLocation`](/documentation/CoreLocation/CLError-swift.struct/Code/deferredNotUpdatingLocation)

A constant that indicates the location manager didn’t enter deferred mode because location updates were already disabled or paused.

### Enumeration cases

[`CLError.Code.historicalLocationError`](/documentation/CoreLocation/CLError-swift.struct/Code/historicalLocationError)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)