-
Couldn't load subscription status.
- Fork 53
Don't throw error even if current token is null #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@plateaukao How do you think about it? IMO, the non-existing token should not be an error, but return a But I am afraid it should not be a |
|
The error case is corresponding to these lines in our Android SDK: https://git.linecorp.com/LINE-Client/linesdk-android/blob/v5.0/line-sdk/src/main/java/com/linecorp/linesdk/api/internal/LineApiClientImpl.java#L150-L154 All internal exceptions are caught inside the AccessTokenCache.getAccessToken method. We cannot tell the difference between As above, we have two choices in
Option 1 is enough to me to solve current situation. But option 2 is more future-oreintated and can handle and propagate real errors to caller. |
| lineApiResponse.errorData.message, | ||
| null | ||
| ) | ||
| result.error(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| result.error(null) | |
| result.success(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In iOS, currentAccessToken does not throw error even if token is null, but currently throw in android.
I want the same behavior on both OS.