diff options
| author | Santosh P K <50885001+Spantik@users.noreply.github.com> | 2020-06-10 22:47:07 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-10 22:47:07 +0530 |
| commit | 57dd2f009739664cbf857a82e7a6970c916b8e10 (patch) | |
| tree | 7187878d1394bbc452ecc1e2bffd5edafb9a920d /lib/libfrr.c | |
| parent | 5e0494b38a53e5a3501088efb4b48b2cbb7a080f (diff) | |
| parent | 1abe6c535e89f8b445c7d5808bc7972a6b60236d (diff) | |
Merge pull request #6414 from opensourcerouting/nb-error-handling
NB context + enhanced error handling
Diffstat (limited to 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index ac165f254e..cac9929577 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -902,14 +902,18 @@ static int frr_config_read_in(struct thread *t) * reading the configuration file. */ if (frr_get_cli_mode() == FRR_CLI_TRANSACTIONAL) { + struct nb_context context = {}; + char errmsg[BUFSIZ] = {0}; int ret; - ret = nb_candidate_commit(vty_shared_candidate_config, - NB_CLIENT_CLI, NULL, true, - "Read configuration file", NULL); + context.client = NB_CLIENT_CLI; + ret = nb_candidate_commit(&context, vty_shared_candidate_config, + true, "Read configuration file", NULL, + errmsg, sizeof(errmsg)); if (ret != NB_OK && ret != NB_ERR_NO_CHANGES) - zlog_err("%s: failed to read configuration file.", - __func__); + zlog_err( + "%s: failed to read configuration file: %s (%s)", + __func__, nb_err_name(ret), errmsg); } return 0; |
