-
Notifications
You must be signed in to change notification settings - Fork 5
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
Pass better information of operation failures #179
Conversation
@@ -24,7 +24,9 @@ class KanbanBoardViewModel(private val client: Client) : ViewModel() { | |||
|
|||
init { | |||
viewModelScope.launch { | |||
if (client.activateAsync().await() && client.attachAsync(document).await()) { | |||
if (client.activateAsync().await().isSuccess && | |||
client.attachAsync(document).await().isFailure |
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 it should be client.attachAsync(document).await().isSuccess
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.
done bb70e2e
@@ -129,7 +130,7 @@ public class Document( | |||
public fun updateAsync( | |||
message: String? = null, | |||
updater: suspend (root: JsonObject, presence: Presence) -> Unit, | |||
): Deferred<Boolean> { | |||
): Deferred<Result<Unit>> { |
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.
typealias OperationResult
can be applied here
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.
done bb70e2e
What this PR does / why we need it?
Changes return type of public operations from Boolean to Result for better information.
This can help users to handle exceptions more precisely.
Also bumps libraries to latest versions.
Any background context you want to provide?
What are the relevant tickets?
Fixes #
Checklist