---
title: "locationManager(_:rangingBeaconsDidFailFor:withError:)"
framework: corelocation
role: symbol
role_heading: Instance Method
path: "corelocation/cllocationmanagerdelegate/locationmanager(_:rangingbeaconsdidfailfor:witherror:)"
---

# locationManager(_:rangingBeaconsDidFailFor:withError:)

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

## Declaration

```swift
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

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.

## See Also

### Receiving beacon-related updates

- [locationManager(_:didRange:satisfying:)](corelocation/cllocationmanagerdelegate/locationmanager(_:didrange:satisfying:).md)
- [locationManager(_:didFailRangingFor:error:)](corelocation/cllocationmanagerdelegate/locationmanager(_:didfailrangingfor:error:).md)
- [locationManager(_:didRangeBeacons:in:)](corelocation/cllocationmanagerdelegate/locationmanager(_:didrangebeacons:in:).md)
