mapbox / mapbox/mapbox-navigation-android

Provide `onRoutesRequestFailure` reason information

Aperta
#4,376 4 commenti 0 reazioni 2 assegnatari Vedi su GitHub

@LukasPaczos ci sta già lavorando.

Dal 5/7/2021.

backwards incompatible feature needs discussion
Lingua principale
Kotlin
Stelle
651
Fork
321
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.