mapbox / mapbox/mapbox-navigation-android

Provide `onRoutesRequestFailure` reason information

Open
#4,376 4 comments 0 reactions 2 assignees View on GitHub

@LukasPaczos is already working on this.

Since Jul 5, 2021.

backwards incompatible feature needs discussion
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.