network/httpclient/exception.go
白茶清欢 89e73cc9d9 优化http请求之后对响应结果的处理
1. http状态验证
2. 业务状态码验证
3. 业务数据提取
4. 异常处理统一使用exception库
2023-08-26 21:31:09 +08:00

28 lines
793 B
Go

// Package httpclient ...
//
// Author: go_developer@163.com<白茶清欢>
//
// Description: 定义异常
//
// File: exception.go
//
// Version: 1.0.0
//
// Date: 2022/05/01 20:40:08
package httpclient
const (
// ResponseCodeNotFound 响应结果获取不到状态码字段
ResponseCodeNotFound = 404000000002
// ResponseDataNotFound 响应结果获取不到数据字段
ResponseDataNotFound = 404000000004
// SendRequestError 请求发送出现异常
SendRequestError = 400000000002
// ReadResponseBodyError 读取响应数据体出现异常
ReadResponseBodyError = 400000000003
// RequestMethodNotSupport 请求方法不支持
RequestMethodNotSupport = 405000000001
// ResponseHttpCodeIsNotSuccess 响应的http状态码非成功
ResponseHttpCodeIsNotSuccess = 500000000001
)