-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Open
Feature
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem?
- If we throw an exception when no Dm found, the return type does not need to be nullable
- For functions that are expected to throw in expected cases like when an id isn't found (not an unexpected error) we should markup with @throws OR consider setting the return type to
Resultso that integrators know they should explicitly handle exceptions in these cases.
fun findDmByInboxId(inboxId: InboxId): Dm? {
return try {
Dm(client, ffiClient.dmConversation(inboxId))
} catch (e: Exception) {
null
}
}
suspend fun findDmByIdentity(publicIdentity: PublicIdentity): Dm? {
val inboxId =
client.inboxIdFromIdentity(publicIdentity)
?: throw XMTPException("No inboxId present")
return findDmByInboxId(inboxId)
}Describe the solution to the problem
No response
Describe the uses cases for the feature
No response
Additional details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
No status