Skip to content

Provide onRoutesRequestFailure reason information #4376

Open
@Guardiola31337

Description

@Guardiola31337

Currently, we're reporting back a Throwable with a tweaked message as a result of

fun requestRoutes(
routeOptions: RouteOptions,
routesRequestCallback: RoutesRequestCallback
): Long {
fun onRoutesRequestFailure(throwable: Throwable, routeOptions: RouteOptions)

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

Metadata

Metadata

Labels

backwards incompatibleRequires a SEMVER major version change.featureNew feature request.needs discussionCan't be started in current state, needs clarification.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions