-
Notifications
You must be signed in to change notification settings - Fork 4
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
Handle ErrClientNotActivated and ErrClientNotFound #213
base: v0.4.27
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
if (yorkieErrorCode == ErrClientNotActivated.codeString || | ||
yorkieErrorCode == ErrClientNotFound.codeString | ||
) { | ||
print("Yorkie error: $yorkieErrorCode") |
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.
I think you can remove print()
here.
*/ | ||
public fun isRetryable(exception: ConnectException?): Boolean { | ||
public suspend fun handleConnectException( |
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.
The visibility can be restricted to internal
.
yorkieErrorCode == ErrClientNotFound.codeString | ||
) { | ||
print("Yorkie error: $yorkieErrorCode") | ||
handleError?.invoke() |
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.
It seems that handleError
is nullable and is passed to handleConnectException()
only in specific cases, whereas the JS SDK always invokeshandleError
here, which is deactivateInternal()
. Are there specific criteria for passing handleError
as null in the Android SDK?
@@ -7,36 +7,36 @@ import kotlin.contracts.contract | |||
* `YorkieError` is an error returned by a Yorkie operation. | |||
*/ | |||
public data class YorkieException(public val code: Code, public val errorMessage: String) : RuntimeException(errorMessage) { | |||
public enum class Code { | |||
public enum class Code(val codeString: String) { |
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.
Can't we just use toString()
instead of explicitly adding codeString
?
What this PR does / why we need it?
I have added the missing changes that was mentioned in the previous PR discussion (#212)
This change is related to the PR for the JS SDK : yorkie-team/yorkie-js-sdk#865
Any background context you want to provide?
Since it was hard to include the entire library containing ErrorInfo as a dependency, I opted to use only a subset of the proto files. I consider this a tricky approach, and if it becomes difficult to maintain in the future, we might need to reconsider the method of transmitting error codes between the server and the client.
What are the relevant tickets?
Fixes #
Checklist