Skip to content

Instantly share code, notes, and snippets.

@timusus
Created October 20, 2018 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timusus/3b2e8057ec6ff2ad67c13db8a8c3b14e to your computer and use it in GitHub Desktop.
Save timusus/3b2e8057ec6ff2ad67c13db8a8c3b14e to your computer and use it in GitHub Desktop.
val responseErrorMapper: (Response<*>) -> Error? = { response ->
response.errorBody()?.string()?.let { errorBody ->
// Is this an OAuthError?
OAuthError.errorData(response, errorBody)?.let { errorData ->
OAuthError(response, errorData)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment