summaryrefslogtreecommitdiff
path: root/lib/northbound_grpc.cpp
diff options
context:
space:
mode:
authorChirag Shah <chirag@nvidia.com>2020-10-03 15:34:33 -0700
committerChirag Shah <chirag@nvidia.com>2020-10-05 13:15:59 -0700
commitf63f5f1947c3b4a99e97494198520f03fb6b063e (patch)
tree8c1071614c685dc9d8a68322ecd6cf0ce85b7e37 /lib/northbound_grpc.cpp
parent002bac8b5bc229f892c66e3c13c4c058a2b10e27 (diff)
*: add errmsg to nb rpc
Display human readable error message in northbound rpc transaction failure. In case of vtysh nb client, the error message will be displayed to user. Testing: bharat# clear evpn dup-addr vni 1002 ip 11.11.11.11 Error type: generic error Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'lib/northbound_grpc.cpp')
-rw-r--r--lib/northbound_grpc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp
index f35b4bb31b..abdae993b1 100644
--- a/lib/northbound_grpc.cpp
+++ b/lib/northbound_grpc.cpp
@@ -962,6 +962,7 @@ class NorthboundImpl
struct listnode *node;
struct yang_data *data;
const char *xpath;
+ char errmsg[BUFSIZ] = {0};
switch (tag->state) {
case CREATE:
@@ -1012,7 +1013,7 @@ class NorthboundImpl
// Execute callback registered for this XPath.
if (nb_callback_rpc(nb_node, xpath, input_list,
- output_list)
+ output_list, errmsg, sizeof(errmsg))
!= NB_OK) {
flog_warn(EC_LIB_NB_CB_RPC,
"%s: rpc callback failed: %s",