package com.rc.httpcore.interceptor

import android.util.Log
import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

class ResponseInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        Log.d("====ResponseInterceptor","拦截器")
        val response = chain.proceed(chain.request())
        if (!response.isSuccessful || response.body() == null) {
            throw IOException("Response failed or body is null")
        }
        return response
    }
}