summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 784f9cf2ac..ffef05e4dc 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2349,12 +2349,18 @@ static void vty_read_file(struct nb_config *config, FILE *confp)
* reading the configuration file.
*/
if (config == NULL) {
- ret = nb_candidate_commit(vty->candidate_config, NB_CLIENT_CLI,
- vty, true, "Read configuration file",
- NULL);
+ struct nb_context context = {};
+ char errmsg[BUFSIZ] = {0};
+
+ context.client = NB_CLIENT_CLI;
+ context.user = vty;
+ ret = nb_candidate_commit(&context, vty->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);
}
vty_close(vty);