Display GitHub API error message in snackbars when available #1433
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds more information to error snackbars when the GitHub API returns an error upon performing an action, in order to help users understand the reason without digging into the logcat:
In these cases, the "Retry" button - which is almost always useless for API errors - is replaced by "Copy error message", which should make it easy to get the full message when reporting an issue or when it's too long to fit in the snackbar, as it's the case with OAuth restriction errors:
When an action fails due to a non-API error, the usual "Retry" button is displayed instead, but the message has been reworded to make it clear that it's most likely a connectivity issue (which should be the only other likely cause of errors, unless we have a bug in the code).
Let me know your thoughts!