twitter-kit-android icon indicating copy to clipboard operation
twitter-kit-android copied to clipboard

Add Status Codes to Exceptions / New Exception types

Open USMCFighter94 opened this issue 5 years ago • 1 comments

This form is for reporting issues in the Twitter Kit Android library. For all other developer questions/issues about Twitter please visit Twitter Community.

We welcome your contributions to improve the SDKs — whether adding new features, creating your own library that uses Twitter Kit, or fixing bugs you find in the code. We'd love to work with you so that Twitter Kit grows with your needs.

Feature Request

Currently, when a user backs out of the Twitter login flow, the failure method in com.twitter.sdk.android.core.Callback is called, with a TwitterException, that contains a message saying that the user cancelled. Thus, if an application using Twitter login wishes to perform a different action for cancelling vs. auth failure, an un-pretty string check of the exception message is required e.g. twitterException.message?.toLowerCase()?.contains("request was canceled").

It would be nice if status codes could be used for the different states, or if a different exception was returned for cancellations, something like TwitterAuthCancelledException. This way string parsing and checking isn't required, and client code can be more readable.

USMCFighter94 avatar Oct 24 '18 15:10 USMCFighter94

This repository is due for retirement on 31st October 2018 per the deprecation announcement, and no further updates are planned.

andypiper avatar Oct 24 '18 15:10 andypiper