Как здесь в catch отображать ошибку с бэка? Тимлид написал такое Можешь попробовать в CashbackRegistrationConfirmPresenterImpl
Отобразить ошибку с бека хотя бы
Типа того:

    val errorMessage = (exception as? BusinessLogicValidException)?.message
        ?: (exception as? BusinessLogicException)?.message
        ?: exception.localizedMessage
    _messageEvent.send(errorMessage) Вот код:package ru.maxi.mobile.presentation.cashback.presenter.confirm

import kotlinx.coroutines.launch
import moxy.InjectViewState
import moxy.MvpPresenter
import moxy.presenterScope
import ru.maxi.mobile.business.cashback.CashbackInteractor
import ru.maxi.mobile.entity.cashback.CashbackState
import ru.maxi.mobile.feature.analytics.model.AnalyticType
import ru.maxi.mobile.feature.analytics.model.actions.AnalyticCashbackActions
import ru.maxi.mobile.feature.analytics.model.events.AnalyticsGeneralEvent
import ru.maxi.mobile.feature.analytics.usecase.AnalyticsUseCase
import ru.maxi.mobile.presentation.cashback.CashbackScreens
import ru.maxi.mobile.presentation.cashback.view.CashbackRegistrationConfirmView
import javax.inject.Inject

/**
 * Презентер подтверждения участия в кешбэке
 */
@InjectViewState
class CashbackRegistrationConfirmPresenterImpl @Inject constructor(
    private val cashbackInteractor: CashbackInteractor,
    private val analyticsUseCase: AnalyticsUseCase,
) : MvpPresenter<CashbackRegistrationConfirmView>(), CashbackRegistrationConfirmPresenter {

    override fun onFirstViewAttach() {
        super.onFirstViewAttach()
        viewState.setTitle(PAGE_TITLE)
        viewState.showBackButton()
    }

    override fun onInfoClick() {
        viewState.navigateTo(CashbackScreens.InfoScreen())
    }

    override fun onConfirmButtonClick() {
        presenterScope.launch {
            try {
                viewState.showBlockLoading()
                analyticsUseCase log AnalyticsGeneralEvent.SelectContent(
                    AnalyticType.CASHBACK,
                    analyticAction = AnalyticCashbackActions.CASHBACK_BUTTON_REGISTRATION_CONFIRM,
                )
                cashbackInteractor.register()
                when (val state = cashbackInteractor.getCashbackState()) {
                    is CashbackState.NoData -> viewState.navigateToRoot(CashbackScreens.NoDataScreen(state.canLeave))

                    is CashbackState.InProcess -> {
                        val screen = if (state.multipleGoals) {
                            CashbackScreens.MultipleGoalsProgressScreen(maximumCashbackReached = false, state.canLeave)
                        } else {
                            CashbackScreens.SingleGoalProgressScreen(state.canLeave)
                        }
                        viewState.navigateToRoot(screen)
                    }

                    is CashbackState.Done -> {
                        val screen = if (state.multipleGoals) {
                            CashbackScreens.MultipleGoalsProgressScreen(maximumCashbackReached = true, state.canLeave)
                        } else {
                            CashbackScreens.DoneScreen(state.canLeave)
                        }
                        viewState.navigateToRoot(screen)
                    }

                    else -> viewState.showSnackbar(REGISTER_ERROR_TEXT)
                }
            } catch (ignore: Exception) {
                viewState.showSnackbar(REGISTER_ERROR_TEXT)
            } finally {
                viewState.hideBlockLoading()
            }
        }
    }

    private companion object {
        const val PAGE_TITLE = "Кешбэк"
        const val REGISTER_ERROR_TEXT = "Во время выполнения операции произошла ошибка"
    }
}