I have a retrofit Service:
suspend fun getArticles(): Articles
and usually I can get response code in try/catch in a case of error.
try {
val articles = service.getArticles()
} catch (e: Exception) {
// I can get only codes different from 200...
}
But what if I need to distinguish between 200 and 202 codes for example and my service returns me only data object?
How to get response code if I have successful response?