Add log stmt to error from mark message as read
This commit is contained in:
parent
0e00d4d2ac
commit
43f462c49d
1 changed files with 8 additions and 0 deletions
|
@ -12,10 +12,16 @@ import io.github.wulkanowy.sdk.scrapper.parseName
|
|||
import io.github.wulkanowy.sdk.scrapper.service.MessagesService
|
||||
import io.github.wulkanowy.sdk.scrapper.toMailbox
|
||||
import io.github.wulkanowy.sdk.scrapper.toRecipient
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.util.UUID
|
||||
|
||||
class MessagesRepository(private val api: MessagesService) {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||
}
|
||||
|
||||
suspend fun getMailboxes(): List<Mailbox> {
|
||||
return api.getMailboxes().map {
|
||||
it.toRecipient()
|
||||
|
@ -81,6 +87,8 @@ class MessagesRepository(private val api: MessagesService) {
|
|||
appVersion = getScriptParam("version", startPage),
|
||||
body = mapOf("apiGlobalKey" to globalKey),
|
||||
)
|
||||
}.onFailure {
|
||||
logger.error("Error occur while marking message as read", it)
|
||||
}.getOrNull()
|
||||
}
|
||||
return details
|
||||
|
|
Loading…
Reference in a new issue