Skip to content

Commit

Permalink
backend_commit: Fix logic on validate error handling
Browse files Browse the repository at this point in the history
The handling of an error from validate_commit() for the rpc_err changes
was incorrect.  If cbret has data in it, use that for the return error.

Signed-off-by: Corey Minyard <corey@minyard.net>
  • Loading branch information
cminyard committed Dec 3, 2024
1 parent 80e3f57 commit 4ef43a1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions apps/backend/backend_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,14 @@ candidate_validate(clixon_handle h,
* use clixon_err.
* TODO: -1 return should be fatal error, not failed validation
*/
if (!cbuf_len(cbret))
goto done;
if (clixon_err_category()) {
if (netconf_operation_failed(cbret, "application",
clixon_err_reason()) < 0)
goto done;
} else if (plugin_rpc_err_set()) {
if (cbuf_len(cbret))
goto fail;
if (plugin_rpc_err_set()) {
if (netconf_gen_rpc_err(cbret) < 0)
goto done;
} else if (netconf_operation_failed(cbret, "application",
clixon_err_reason()) < 0) {
goto done;
}
goto fail;
}
Expand Down

0 comments on commit 4ef43a1

Please sign in to comment.