Skip to content

Commit 63cb30c

Browse files
authored
[Chain] Improve error message when provider can not *reverse* geocode (#986)
* Update Chain.php Apply PR #880 to reverse geocoding * Update CHANGELOG.md
1 parent bc61b65 commit 63cb30c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Provider/Chain/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 4.1.1
6+
7+
### Fixed
8+
9+
- Fix (and improve) error message when provider can not **reverse** geocode
10+
511
## 4.1.0
612

713
### Added

src/Provider/Chain/Chain.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,16 @@ public function reverseQuery(ReverseQuery $query): Collection
103103
}
104104
} catch (\Throwable $e) {
105105
$coordinates = $query->getCoordinates();
106+
106107
$this->log(
107108
$this->reverseQueryLogLevel,
108-
sprintf('Provider "%s" could reverse coordinates: %f, %f.', $provider->getName(), $coordinates->getLatitude(), $coordinates->getLongitude()),
109-
['exception' => $e]
109+
'Provider "{providerName}" could not reverse geocode coordinates: {latitude}, {longitude}".',
110+
[
111+
'exception' => $e,
112+
'providerName' => $provider->getName(),
113+
'latitude' => $coordinates->getLatitude(),
114+
'longitude' => $coordinates->getLongitude(),
115+
]
110116
);
111117
}
112118
}

0 commit comments

Comments
 (0)