MCPcopy Create free account
hub / github.com/DNAProject/DNA / NewRpcError

Function NewRpcError

cmd/utils/rpc.go:49–60  ·  view source on GitHub ↗
(err error, errCode ...int64)

Source from the content-addressed store, hash-verified

47}
48
49func NewRpcError(err error, errCode ...int64) *RpcError {
50 ontErr := &RpcError{Error: err}
51 if len(errCode) > 0 {
52 ontErr.ErrorCode = errCode[0]
53 } else {
54 ontErr.ErrorCode = ERROR_RPC_COMMON
55 }
56 if err == nil {
57 ontErr.ErrorCode = ERROR_RPC_SUCCESS
58 }
59 return ontErr
60}
61
62//JsonRpcRequest object in rpc
63type JsonRpcRequest struct {

Callers 1

sendRpcRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected