added detailed network error message
This commit is contained in:
parent
2479fc9b47
commit
45a0541533
|
@ -44,7 +44,11 @@ private fun MicroBlogException.getMicroBlogErrorMessage(context: Context): Strin
|
|||
val nextResetTime = DateUtils.getRelativeTimeSpanString(System.currentTimeMillis() + secUntilReset)
|
||||
return context.getString(R.string.error_message_rate_limit, nextResetTime.trim())
|
||||
} else if (isCausedByNetworkIssue) {
|
||||
return context.getString(R.string.message_toast_network_error)
|
||||
val msg = cause?.message
|
||||
if (msg.isNullOrEmpty()) {
|
||||
return context.getString(R.string.message_toast_network_error)
|
||||
}
|
||||
return context.getString(R.string.message_toast_network_error_with_message, msg)
|
||||
}
|
||||
val msg = if (StatusCodeMessageUtils.containsTwitterError(errorCode)) {
|
||||
StatusCodeMessageUtils.getTwitterErrorMessage(context, errorCode)
|
||||
|
|
|
@ -677,6 +677,7 @@
|
|||
<string name="message_toast_login_verification_failed">Login verification failed</string>
|
||||
<!-- Toast message for network errors -->
|
||||
<string name="message_toast_network_error">Network error</string>
|
||||
<string name="message_toast_network_error_with_message">Network error: <xliff:g id="message">%s</xliff:g></string>
|
||||
<string name="message_toast_no_account">No account</string>
|
||||
<string name="message_toast_no_account_permission">Account permission is required</string>
|
||||
<string name="message_toast_no_account_selected">No account selected</string>
|
||||
|
|
Loading…
Reference in New Issue