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
Result so 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
Is your feature request related to a problem?
Resultso that integrators know they should explicitly handle exceptions in these cases.Describe the solution to the problem
No response
Describe the uses cases for the feature
No response
Additional details
No response