[NOD-1397] Add to rpc client ErrRPC (#934)

This commit is contained in:
Ori Newman 2020-09-17 19:26:03 +03:00 committed by GitHub
parent 798abf2103
commit 34a1b30006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,8 +63,11 @@ func (c *RPCClient) route(command appmessage.MessageCommand) *routerpkg.Route {
return c.rpcRouter.routes[command]
}
// ErrRPC is an error in the RPC protocol
var ErrRPC = errors.New("rpc error")
func (c *RPCClient) convertRPCError(rpcError *appmessage.RPCError) error {
return errors.Errorf("received error response from RPC: %s", rpcError.Message)
return errors.Wrap(ErrRPC, rpcError.Message)
}
// SetLogger uses a specified Logger to output package logging info