<!--
{
  "availability" : [
    "iOS: 7.0.0 - 13.0.0",
    "iPadOS: 7.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.15.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreLocation",
  "identifier" : "/documentation/CoreLocation/CLLocationManagerDelegate/locationManager(_:rangingBeaconsDidFailFor:withError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Location"
    ],
    "preciseIdentifier" : "c:objc(pl)CLLocationManagerDelegate(im)locationManager:rangingBeaconsDidFailForRegion:withError:"
  },
  "title" : "locationManager(_:rangingBeaconsDidFailFor:withError:)"
}
-->

# locationManager(_:rangingBeaconsDidFailFor:withError:)

Tells the delegate that an error occurred while gathering ranging information for a set of beacons.

```
optional func locationManager(_ manager: CLLocationManager, rangingBeaconsDidFailFor region: CLBeaconRegion, withError error: any Error)
```

## Parameters

`manager`

The location manager object reporting the event.

`region`

The region object that encountered the error.

`error`

An error object containing the error code that indicates why ranging failed.

## Discussion

Errors occur most often when registering a beacon region failed. If the region object itself is invalid or if it contains invalid data, the location manager calls this method to report the problem.

---

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)