UnauthorizedResponseInterceptor

Checks whether the HTTP response has a status code of 401 (Unauthorized). If the response status code matches HttpStatusCode.Unauthorized, it maps the response to a NetworkResponse.Error containing an KaliumException.Unauthorized exception with the HTTP status code as its error code.

See also

Functions

Link copied to clipboard
open suspend override fun intercept(httpResponseData: HttpResponseData): NetworkResponse.Error?

Intercepts the provided HTTP response to determine if it can be mapped to a specific NetworkResponse.