diff options
| author | Quentin Young <qlyoung@nvidia.com> | 2020-08-18 15:59:41 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@nvidia.com> | 2020-08-19 14:24:32 -0400 |
| commit | 5bfb669b377ab5980dd2cb137e1bb28849a8efe1 (patch) | |
| tree | ccbe8105625b9fe0ff31ae2a895e35b23031715d /lib/northbound_grpc.cpp | |
| parent | 105864626158d819cde5d110364cdc05f827bd75 (diff) | |
lib: fill nb errmsg when no changes during prep
During the prep phase to apply a northbound commit, if no changes were
detected make sure we fill the error message buffer to explain this.
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to 'lib/northbound_grpc.cpp')
| -rw-r--r-- | lib/northbound_grpc.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp index fc81099ca8..a7b4f843eb 100644 --- a/lib/northbound_grpc.cpp +++ b/lib/northbound_grpc.cpp @@ -714,46 +714,38 @@ class NorthboundImpl grpc::Status status; switch (ret) { case NB_OK: - zlog_debug("`-> Result: OK"); status = grpc::Status::OK; break; case NB_ERR_NO_CHANGES: - zlog_debug("`-> Result: ERR_NO_CHANGES (message: '%s')", - errmsg); status = grpc::Status(grpc::StatusCode::ABORTED, errmsg); break; case NB_ERR_LOCKED: - zlog_debug("`-> Result: ERR_LOCKED (message: '%s')", - errmsg); status = grpc::Status( grpc::StatusCode::UNAVAILABLE, errmsg); break; case NB_ERR_VALIDATION: - zlog_debug( - "`-> Result: ERR_VALIDATION (message: '%s')", - errmsg); status = grpc::Status( grpc::StatusCode::INVALID_ARGUMENT, errmsg); break; case NB_ERR_RESOURCE: - zlog_debug( - "`-> Result: ERR_RESOURCE (message: '%s')", - errmsg); status = grpc::Status( grpc::StatusCode::RESOURCE_EXHAUSTED, errmsg); break; case NB_ERR: default: - zlog_debug( - "`-> Result: Generic error (message: '%s')", - errmsg); status = grpc::Status( grpc::StatusCode::INTERNAL, errmsg); break; } + + if (nb_dbg_client_grpc) + zlog_debug("`-> Result: %s (message: '%s')", + nb_err_name((enum nb_error)ret), + errmsg); + if (ret == NB_OK) { // Response: uint32 transaction_id = 1; if (transaction_id) |
