public interface ErrorDecoder
当请求发生异常或者收到无效响应结果的时候,将HTTP相关信息解码到异常中,无效响应由业务自己判断
When an exception occurs in the request or an invalid response result is received, the HTTP related information is decoded into the exception, and the invalid response is determined by the business itself.
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
ErrorDecoder.DefaultErrorDecoder |
| 限定符和类型 | 方法和说明 |
|---|---|
default RuntimeException |
exceptionDecode(okhttp3.Request request,
Exception cause)
当请求发生除IO异常之外的其它异常时,将HTTP信息解码到异常中。
|
default RuntimeException |
invalidRespDecode(okhttp3.Request request,
okhttp3.Response response)
当无效响应的时候,将HTTP信息解码到异常中,无效响应由业务自行判断。
|
default RuntimeException |
ioExceptionDecode(okhttp3.Request request,
IOException cause)
当请求发生IO异常时,将HTTP信息解码到异常中。
|
default RuntimeException invalidRespDecode(okhttp3.Request request, okhttp3.Response response)
When the response is invalid, decode the HTTP information into the exception, invalid response is determined by business.
request - requestresponse - responsedefault RuntimeException ioExceptionDecode(okhttp3.Request request, IOException cause)
When an IO exception occurs in the request, the HTTP information is decoded into the exception.
request - requestcause - IOExceptiondefault RuntimeException exceptionDecode(okhttp3.Request request, Exception cause)
When the request has an exception other than the IO exception, the HTTP information is decoded into the exception.
request - requestcause - ExceptionCopyright © 2024. All rights reserved.