Skip to content

Commit

Permalink
Merge pull request #2374 from mapbox/2273-errors-clarification
Browse files Browse the repository at this point in the history
Offline Directions errors-clarification
  • Loading branch information
Udumft authored Jul 16, 2020
2 parents c46bf48 + 62d4ee3 commit f2f78ce
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 41 deletions.
12 changes: 1 addition & 11 deletions MapboxCoreNavigation/OfflineDirections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ public enum OfflineRoutingError: LocalizedError {
A Directions API error can occur whether directions are calculated online or offline.
*/
case standard(DirectionsError)

/**
The router returned an empty response.
*/
case noData

/**
The router returned a response that isn’t correctly formatted.
*/
Expand All @@ -34,8 +28,6 @@ public enum OfflineRoutingError: LocalizedError {
switch self {
case .standard(let error):
return error.localizedDescription
case .noData:
return 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")
case .invalidResponse:
return NSLocalizedString("OFFLINE_CORRUPT_DATA", bundle: .mapboxCoreNavigation, value: "Found an invalid route while offline.", comment: "Error message when an offline route request returns a response that can’t be deserialized")
case .unknown(let underlying):
Expand Down Expand Up @@ -176,6 +168,7 @@ public class NavigationDirections: Directions {
- parameter options: A `RouteOptions` object specifying the requirements for the resulting routes.
- parameter offline: Determines whether to calculate the route offline or online.
- parameter completionHandler: The closure (block) to call with the resulting routes. This closure is executed on the application’s main thread.
If called `NavigationDirections` instance is deallocated before route calculation is finished - completion won't be called.
*/
public func calculate(_ options: RouteOptions, offline: Bool = true, completionHandler: @escaping OfflineRouteCompletionHandler) {

Expand All @@ -197,9 +190,6 @@ public class NavigationDirections: Directions {

NavigationDirectionsConstants.offlineSerialQueue.async { [weak self] in
guard let result = self?.navigator.getRouteForDirectionsUri(url.absoluteString) else {
DispatchQueue.main.async {
completionHandler(session, .failure(.noData))
}
return
}

Expand Down
3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Found an invalid route while offline.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Unable to calculate the requested route while offline.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Mapbox Navigation SDK for iOS version %@ is now available.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Es wurde eine ungültige Route berechnet, da keine Verbindung besteht.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Es ist nicht möglich, die gewünschte Route zu berechnen, da keine Verbindung besteht.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Mapbox Navigation SDK für iOS Version %@ ist jetzt verfügbar.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Ha encontrado una ruta no válida en modo offline.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "No se puede calcular la ruta peticionada en modo offline.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "La versión %@ de Mapbox Navigation SDK para iOS está disponible.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Impossible de charger cet itinéraire hors ligne";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Impossible de calculer cet itinéraire hors ligne";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "La version %@ du SDK iOS Mapbox est maintenant disponible";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "オフラインの為ルートを作成できません";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "オフラインの為、ルートを作成できません";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "iOS %@用 Mapbox Navigation SDKが使用できます";

Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Foi encontrada uma rota inválida desligado da internet.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Não é possível calcular a rota pedida desligado da internet.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "O SDK de Navegação Mapbox para iOS versão %@ já está disponível.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Получен неверный маршрут без интернета.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Требуемый маршрут невозможно рассчитать без интернета.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Доступна версия Mapbox Navigation SDK %@ для iOS.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Ogiltligt offline-rutt.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Kunde inte beräkna rutten i offline-läge.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Mapbox Navigation SDK for iOS version %@ är nu tillgängligt.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/vi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Đã tìm thấy tuyến đường không hợp lệ trong khi ngoại tuyến.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Không tìm thấy tuyến đường trong khi ngoại tuyến.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Mapbox Navigation SDK cho iOS mới ra phiên bản %@.";

3 changes: 0 additions & 3 deletions MapboxCoreNavigation/Resources/yo.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Error message when an offline route request returns a response that can’t be deserialized */
"OFFLINE_CORRUPT_DATA" = "Found an invalid route while offline.";

/* Error description when an offline route request returns no result */
"OFFLINE_NO_RESULT" = "Unable to calculate the requested route while offline.";

/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Mapbox Navigation SDK for iOS version %@ is now available.";

0 comments on commit f2f78ce

Please sign in to comment.