mapbox / mapbox/mapbox-navigation-android
Provide `onRoutesRequestFailure` reason information
@LukasPaczos is already working on this.
Since Jul 5, 2021.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
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).
`Reason`s may include offline vs service error, authentication failure, bad request, etc.
cc @mapbox/navigation-android
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.