Skip to content

Commit 620c3bc

Browse files
committed
schema mount UPDATE improve logging
1 parent d08cdd3 commit 620c3bc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/plugins_exts/schema_mount.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ schema_mount_create_ctx(const struct lysc_ext_instance *ext, const struct lyd_no
320320

321321
/* create the context based on the data */
322322
if ((rc = ly_ctx_new_yldata(sdirs, ext_data, ly_ctx_get_options(ext->module->ctx), ext_ctx))) {
323-
lyplg_ext_compile_log(NULL, ext, LY_LLERR, rc, "Failed to create context for the schema-mount data.");
323+
lyplg_ext_compile_log(NULL, ext, LY_LLERR, rc, "Failed to create context for the schema-mount data (%s).",
324+
ly_last_logmsg());
324325
goto cleanup;
325326
}
326327

@@ -975,7 +976,11 @@ schema_mount_validate(struct lysc_ext_instance *ext, struct lyd_node *sibling, c
975976
if (!err) {
976977
lyplg_ext_compile_log(NULL, ext, LY_LLERR, ret, "Unknown validation error (err code %d).", ret);
977978
} else {
978-
lyplg_ext_compile_log_err(err, ext);
979+
while (err) {
980+
lyplg_ext_compile_log_err(err, ext);
981+
err = err->next;
982+
}
983+
ly_err_clean((struct ly_ctx *)LYD_CTX(sibling), NULL);
979984
}
980985
goto cleanup;
981986
}

0 commit comments

Comments
 (0)