mapbox / mapbox/mapbox-navigation-android

Provide `onRoutesRequestFailure` reason information

Offen
#4,376 4 Kommentare 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

@LukasPaczos arbeitet bereits daran.

Seit 05.7.2021.

backwards incompatible feature needs discussion
Vorherrschende Sprache
Kotlin
Sterne
651
Forks
321
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, we're reporting back a Throwable with a tweaked message as a result of https://github.com/mapbox/mapbox-navigation-android/blob/306f2919494f7731a0b3515a9d3d9cae5bd0ad07/libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt#L386-L389 https://github.com/mapbox/mapbox-navigation-android/blob/306f2919494f7731a0b3515a9d3d9cae5bd0ad07/libnavigation-core/src/main/java/com/mapbox/navigation/core/directions/session/RoutesRequestCallback.kt#L34

Clients can parse the string Throwable.message or print the whole thing but there isn't an easy way to tell the user the reason e.g. if it was offline or service error:

if ( /* is offline error */ ) 
   // display prompt telling user to check network connection
else
   // display user message apologizing for service being down

This can't be easily implemented with given information from the Throwable.

This ticket tracks the feature request of adding some kind of Error object including the Reason so that developers can use this extra information to act accordingly to their use cases (e.g. to determine what messaging to display).

Reasons may include offline vs service error, authentication failure, bad request, etc.

cc @mapbox/navigation-android

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.