You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guard let result =self?.navigator.getRouteForDirectionsUri(url.absoluteString)else{
letmessage=NSLocalizedString("OFFLINE_NO_RESULT", bundle:.mapboxCoreNavigation, value:"Unable to calculate the requested route while offline.", comment:"Error description when an offline route request returns no result")
Currently we're only returning the OFFLINE_NO_RESULT error if the directions client is improperly handled (self is nil when the asynchronous closure executes.) We should have a separate error for that, and actually check the result to ensure no error was returned from nav native.
/cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered:
The suggestion is to break up the guard statement so that it only checks whether self (NavigationDirections) is still around; a let further down can call getRouteForDirectionsUri(_:).
1ec5
changed the title
Offline errors are badly written.
Misleading guard statement in NavigationDirections.calculate(_:)
Mar 3, 2020
mapbox-navigation-ios/MapboxCoreNavigation/OfflineDirections.swift
Lines 151 to 157 in 420b287
Currently we're only returning the
OFFLINE_NO_RESULT
error if the directions client is improperly handled (self
isnil
when the asynchronous closure executes.) We should have a separate error for that, and actually check the result to ensure no error was returned from nav native./cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered: