NetworkConnectionInterceptor

class NetworkConnectionInterceptor(val context: Context) : Interceptor

Interceptor class for checking network connection.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard

The application context.

Functions

Link copied to clipboard
open override fun intercept(chain: Interceptor.Chain): Response

Intercepts the chain and checks for network connection. If there is no connection, it throws an IOException. Otherwise, it proceeds with the chain.