From 393276904985b25b7fa1d371ec088937cd61c75f Mon Sep 17 00:00:00 2001 From: Mark Drzycimski Date: Tue, 28 Oct 2025 12:26:33 -0500 Subject: [PATCH] Log Google Maps Geocoding API errors --- src/services/GeoService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/GeoService.php b/src/services/GeoService.php index c83ad64..4696f41 100644 --- a/src/services/GeoService.php +++ b/src/services/GeoService.php @@ -740,6 +740,11 @@ private static function _latLngFromAddress_Google ($token, $address, $country): $data = (string) static::_client()->get($url)->getBody(); $data = Json::decodeIfJson($data); + if (is_array($data) && array_key_exists('error_message', $data)) { + Craft::error('Google Maps Geocoding API error: ' . $data['error_message'], 'maps'); + return null; + } + if (!is_array($data) || empty($data['results'])) return null;