Documentation ¶
Index ¶
Constants ¶
View Source
const ( Success = 200 // 成功返回 Unknown = 730 // 用户过程返回了错误,但不是LittleRpc可以识别的错误 ServiceNotFound = 750 // 需要调用的服务不存在 MessageDecodingFailed = 780 // 载荷消息解码失败 MessageEncodingFailed = 1060 // 载荷消息编码失败 ServerError = 690 // 服务器的其它错误 ClientError = 580 // 客户端产生的错误 // CallArgsTypeErr TODO: 计划删除, v0.2.0时代的遗留产物 CallArgsTypeErr = 1030 // 过程的调用参数类型错误 CodecMarshalErr = 1050 // Codec在序列化数据时出错 ConnectionErr = 1070 // 连接错误 ContextNotFound = 1080 // 要取消的context不存在 UnsafeOption = 2060 // 不安全的选项, 通常在服务器需要的东西没有准备好时触发 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LErrorDesc ¶
type LErrorDesc interface { Code() int Message() string AppendMore(more interface{}) Mores() []interface{} MarshalMores() ([]byte, error) UnmarshalMores([]byte) error error }
func LNewStdError ¶
func LNewStdError(code int, message string, mores ...interface{}) LErrorDesc
func LWarpStdError ¶ added in v0.3.8
func LWarpStdError(desc LErrorDesc, mores ...interface{}) LErrorDesc
type LErrors ¶ added in v0.3.8
type LErrors interface { // LNewErrorDesc 用于生产LittleRpc中的标准错误 LNewErrorDesc(code int, message string, mores ...interface{}) LErrorDesc // LWarpErrorDesc 用于包装LittleRpc中的标准错误 LWarpErrorDesc(desc LErrorDesc, mores ...interface{}) LErrorDesc }
type LNewErrorDesc ¶
type LNewErrorDesc func(code int, message string, mores ...interface{}) LErrorDesc
type LStdError ¶
type LStdError struct { LCode Code `json:"code"` LMessage string `json:"message"` LMores []interface{} `json:"mores"` }
func (*LStdError) AppendMore ¶
func (L *LStdError) AppendMore(more interface{})
func (*LStdError) MarshalMores ¶
func (*LStdError) UnmarshalMores ¶
type LWarpErrorDesc ¶ added in v0.3.8
type LWarpErrorDesc func(desc LErrorDesc, mores ...interface{}) LErrorDesc
Click to show internal directories.
Click to hide internal directories.