mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Street Level: a geocoder that throws fails show_street_level at its location stage
A provider that threw while geocoding (offline, an upstream down) escaped
the action as a bare error. show_street_level now reports it as its
location stage ("Could not arrive at …", the cause in detail), and nothing
is switched or looked up; fly_to_location itself is unchanged.
This commit is contained in:
1 parent
8334262109
commit
a8970c1f18
2 files changed
+41
-13
No files matched your search
+22
-13
@@ -3961,19 +3961,28 @@ async function requestStreetLevel(
|
||||
if (atViewCentre || (args.fly === false && hasCoordinates)) {
|
||||
if (hasCoordinates) point = { lat: latitude, lon: longitude };
|
||||
} else {
|
||||
location = await runGevAction(
|
||||
'fly_to_location',
|
||||
{
|
||||
...(entity
|
||||
? { entity }
|
||||
: hasCoordinates
|
||||
? { latitude, longitude }
|
||||
: { query }),
|
||||
viewMode: 'close',
|
||||
waitForArrival: true,
|
||||
},
|
||||
runOptions,
|
||||
);
|
||||
try {
|
||||
location = await runGevAction(
|
||||
'fly_to_location',
|
||||
{
|
||||
...(entity
|
||||
? { entity }
|
||||
: hasCoordinates
|
||||
? { latitude, longitude }
|
||||
: { query }),
|
||||
viewMode: 'close',
|
||||
waitForArrival: true,
|
||||
},
|
||||
runOptions,
|
||||
);
|
||||
} catch (error) {
|
||||
// A geocoder that throws (offline, a provider down) is this stage's
|
||||
// failure too, not an error past the action.
|
||||
return fail('location', `Could not arrive at ${label}`, {
|
||||
cancelled: !current(),
|
||||
detail: String(error?.message || error),
|
||||
});
|
||||
}
|
||||
if (location?.ok !== true || !current())
|
||||
return fail(
|
||||
'location',
|
||||
|
||||
Reference in new issue
Block a user