Skip to content

Conversation

@danesfeder
Copy link
Contributor

We are currently checking / passing error responses to Callback#onFailure. From the Retrofit javadoc > Callback#onFailure:

Invoked when a network exception occurred talking to the server or when an unexpected exception occurred creating the request or processing the response.

Technically, when we receive an error code (DirectionsError) from either the Directions or MapMatching API, this scenario is not occurring so we shouldn't force the error message to onFailure wrapped in a Throwable.

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work removing the unnecessary wrapper for the "unsuccessful responses" and cleaning up the code / extracting Directions and Map Matching response factories 💪

@danesfeder danesfeder merged commit 30f299c into master Feb 12, 2019
@danesfeder danesfeder deleted the dan-error-scenario branch February 12, 2019 18:36
@osana osana mentioned this pull request Feb 12, 2019
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants