package com.gh.common.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.ErrorHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IErrorHelperProvider
import retrofit2.HttpException

@Route(path = RouteConsts.provider.errorHelper, name = "ErrorHelper暴露服务")
class ErrorHelperProviderImpl : IErrorHelperProvider {

    override fun handleError(
        context: Context,
        errorString: String?,
        showHighPriorityHint: Boolean
    ) {
        ErrorHelper.handleError(context, errorString, showHighPriorityHint)
    }

    override fun handleLoginError(context: Context, httpException: HttpException?) {
        ErrorHelper.handleLoginError(context, httpException)
    }

    override fun init(context: Context?) {
        // Do nothing
    }
}