Skip to the content.

NetworkResponse Adapter 🚀

License: AGPL v3

A powerful Retrofit CallAdapter for elegant and type-safe network response handling in Android applications.

Why NetworkResponse Adapter?

Say goodbye to messy try-catch blocks and hello to clean, expressive error handling!

Quick Example

interface ApiService {
    @GET("users")
    suspend fun getUsers(): NetworkResponse<List<User>, ErrorResponse>
}

// Clean error handling
when (val response = apiService.getUsers()) {
    is NetworkResponse.Success -> {
        val users = response.body
        updateUI(users)
    }
    is NetworkResponse.ServerError -> {
        showError(response.body?.message)
    }
    is NetworkResponse.NetworkError -> {
        showOfflineMessage()
    }
    is NetworkResponse.UnknownError -> {
        logError(response.error)
    }
}

Get Started

Check out the Installation Guide to add NetworkResponse Adapter to your project.

Documentation

Support


Made with ❤️ by NavGurukul