Check retval value and convert to error in generated RPC client code
[govpp.git] / binapi / arp / arp_rpc.ba.go
index 8ccfa75..6e60bf3 100644 (file)
@@ -5,12 +5,13 @@ package arp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
-// RPCService defines RPC service  arp.
+// RPCService defines RPC service arp.
 type RPCService interface {
        ProxyArpAddDel(ctx context.Context, in *ProxyArpAddDel) (*ProxyArpAddDelReply, error)
        ProxyArpDump(ctx context.Context, in *ProxyArpDump) (RPCService_ProxyArpDumpClient, error)
@@ -32,7 +33,7 @@ func (c *serviceClient) ProxyArpAddDel(ctx context.Context, in *ProxyArpAddDel)
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }
 
 func (c *serviceClient) ProxyArpDump(ctx context.Context, in *ProxyArpDump) (RPCService_ProxyArpDumpClient, error) {
@@ -119,5 +120,5 @@ func (c *serviceClient) ProxyArpIntfcEnableDisable(ctx context.Context, in *Prox
        if err != nil {
                return nil, err
        }
-       return out, nil
+       return out, api.RetvalToVPPApiError(out.Retval)
 }