diff --git a/src/main/kotlin/failchat/core/AppStateTransitionManager.kt b/src/main/kotlin/failchat/core/AppStateTransitionManager.kt index 43928dd2..550fb417 100644 --- a/src/main/kotlin/failchat/core/AppStateTransitionManager.kt +++ b/src/main/kotlin/failchat/core/AppStateTransitionManager.kt @@ -108,9 +108,13 @@ class AppStateTransitionManager(private val kodein: Kodein) { // load BTTV channel emoticons in background bttvApiClient.loadChannelEmoticons(channelName) - .thenAccept { - emoticonStorage.putCodeMapping(Origin.bttvChannel, it.map { it.code.toLowerCase() to it }.toMap()) - emoticonStorage.putList(Origin.bttvChannel, it) + .thenApply { emoticons -> + emoticonStorage.putCodeMapping(Origin.bttvChannel, emoticons.map { it.code.toLowerCase() to it }.toMap()) + emoticonStorage.putList(Origin.bttvChannel, emoticons) + log.info("BTTV emoticons loaded for channel '{}', count: {}", channelName, emoticons.size) + } + .exceptionally { e -> + log.warn("Failed to load BTTV emoticons for channel '{}'", channelName, e) } }