wrapRequest
internal inline suspend fun <ResponseType : Any> wrapRequest(customErrorInterceptor: ErrorResponseInterceptor<ResponseType>? = null, json: <Error class: unknown class> = KtxSerializer.json, performRequest: () -> <Error class: unknown class>): NetworkResponse<ResponseType>
internal inline suspend fun <ResponseType : Any> wrapRequest(customErrorInterceptor: ErrorResponseInterceptor<ResponseType>? = null, successHandler: suspend (<Error class: unknown class>) -> NetworkResponse<ResponseType>, json: <Error class: unknown class> = KtxSerializer.json, performRequest: () -> <Error class: unknown class>): NetworkResponse<ResponseType>
Handles an HTTP response with an error status, transforming it into a corresponding NetworkResponse.
Return
A NetworkResponse representing the error, which may either include specific error details or a generic error object.
Parameters
performRequest
An HTTP response producer
customErrorInterceptor
An optional interceptor for custom error responses. This interceptor will be executed after more critical interceptors, like UnauthorizedResponseInterceptor and FederationErrorResponseInterceptor, but before the BaseErrorResponseInterceptor.
successHandler
A handler for successful HTTP responses (status codes 200..299). By default, it will deserialize the body to the wanted ResponseType.