Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Adjust logging level for failed OkHttp requests #6356

Closed
zugaldia opened this issue Sep 16, 2016 · 0 comments
Closed

Adjust logging level for failed OkHttp requests #6356

zugaldia opened this issue Sep 16, 2016 · 0 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@zugaldia
Copy link
Member

Currently, all failed OkHttp requests are logged as a warning:

 Log.w(LOG_TAG, String.format("[HTTP] Request could not be executed: %s", e.getMessage()));

This doesn't make sense, for example, when the device is not connected to the network (offline mode) and the NoRouteToHostException is expected. Instead, I suggest we log according to the levels defined in the HTTPRequest class (CONNECTION_ERROR, TEMPORARY_ERROR, PERMANENT_ERROR). Something like:

if (type == PERMANENT_ERROR) {
    Log.w(...);
} else if (type == TEMPORARY_ERROR) {
    Log.i(...);
} else if (type == CONNECTION_ERROR) {
    Log.d(...);
}

Thoughts @mapbox/android ?

@zugaldia zugaldia added the Android Mapbox Maps SDK for Android label Sep 16, 2016
@zugaldia zugaldia added this to the android-v4.2.0 milestone Sep 16, 2016
@zugaldia zugaldia self-assigned this Sep 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

1 participant