title: CLGeocoder error. GEOErrorDomain Code=-3
body: <p>When I tried to use reverse geocoding,this error message showed up.</p>
  
  <blockquote>
    <p>Geocode error: Error Domain=GEOErrorDomain Code=-3 "(null)"</p>
  </blockquote>
  
  <p>My code is below:</p>
  
  <pre><code>import CoreLocation
  geocoder.reverseGeocodeLocation(location) { (placemarks, error) in
      if let placemarks = placemarks {
          reverseGeocodeLocations[hash] = placemarks
      }
      callback(placemarks, error)
  }
  </code></pre>
  
  <p>This works only time to time, and I request reverseGeocode several times per seconds. So I guess this error message is related to the limit of request or something?
  Is there any documentation about apple’s geocode request?
  Thanks for advance.</p>
  
  <hr>
  
  <p>Updated</p>
  
  <p>here is my entire code for requesting</p>
  
  <pre><code>import CoreLocation
  
  fileprivate struct ReverseGeocodeRequest {
  
      private static let geocoder = CLGeocoder()
      private static var reverseGeocodeLocations = [Int: [CLPlacemark]]()
      private static let reverseGeocodeQueue = DispatchQueue(label: "ReverseGeocodeRequest.reverseGeocodeQueue")
  
      private static var nextPriority: UInt = 0
  
      fileprivate static func request(location: CLLocation, callback: @escaping ([CLPlacemark]?, Error?)-&gt;Void) {
          let hash = location.hash
          if let value = reverseGeocodeLocations[hash] {
              callback(value, nil)
          } else {
              reverseGeocodeQueue.async {
                  guard let value = reverseGeocodeLocations[hash] else {
                      geocoder.reverseGeocodeLocation(location) { (placemarks, error) in
                          if let placemarks = placemarks {
                              reverseGeocodeLocations[hash] = placemarks
                          }
                          callback(placemarks, error)
                      }
                      return
                  }
                  callback(value, nil)
              }
          }
      }
  
  
  
      let priority: UInt
      let location: CLLocation
      let handler : ([CLPlacemark]?, Error?)-&gt;Void
  
      private init (location: CLLocation, handler: @escaping ([CLPlacemark]?, Error?)-&gt;Void) {
          ReverseGeocodeRequest.nextPriority += 1
          self.priority = ReverseGeocodeRequest.nextPriority
          self.location = location
          self.handler  = handler
      }
  
  }
  
  extension ReverseGeocodeRequest: Comparable {
      static fileprivate func &lt; (lhs: ReverseGeocodeRequest, rhs: ReverseGeocodeRequest) -&gt; Bool {
          return lhs.priority &lt; rhs.priority
      }
      static fileprivate func == (lhs: ReverseGeocodeRequest, rhs: ReverseGeocodeRequest) -&gt; Bool {
          return lhs.priority == rhs.priority
      }
  
  }
  
  
  extension CLLocation {
  
      func reverseGeocodeLocation(callback: @escaping ([CLPlacemark]?, Error?)-&gt;Void) {
          ReverseGeocodeRequest.request(location: self, callback: callback)
      }
  
      func getPlaceName(callback: @escaping (Error?, String?)-&gt;Void) {
          self.reverseGeocodeLocation { (placemarks, error) in
              guard let placemarks = placemarks, error == nil else {
                  callback(error, nil)
                  return
              }
              guard let placemark = placemarks.first else {
                  callback(nil, "Mysterious place")
                  return
              }
  
              if let areaOfInterest = placemark.areasOfInterest?.first {
                  callback(nil, areaOfInterest)
              } else if let locality = placemark.locality {
                  callback(nil, locality)
              } else {
                  callback(nil, "On the Earth")
              }
          }
      }
  }
  </code></pre>