schema CHANGE add summarizing error messages when module parsing/compiling failed
diff --git a/src/tree_schema.c b/src/tree_schema.c
index fa9a8ee..137830e 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -939,6 +939,11 @@
return LY_SUCCESS;
error:
+ if (!submod || !submod->name) {
+ LOGERR(ctx, ret, "Parsing submodule failed.");
+ } else {
+ LOGERR(ctx, ret, "Parsing submodule \"%s\" failed.", submod->name);
+ }
lysp_submodule_free(ctx, submod);
if (format == LYS_IN_YANG) {
yang_parser_ctx_free(yangctx);
@@ -1091,6 +1096,12 @@
error_ctx:
ly_set_rm(&ctx->list, mod, NULL);
error:
+ if (!mod || !mod->name) {
+ LOGERR(ctx, ret, "Parsing module failed.");
+ } else {
+ LOGERR(ctx, ret, "Parsing module \"%s\" failed.", mod->name);
+ }
+
lys_module_free(mod, NULL);
if (pctx) {
ly_set_erase(&pctx->tpdfs_nodes, NULL);
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index e5cced0..b8f317c 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -7478,6 +7478,8 @@
}
}
+ LOGERR(ctx.ctx, ret, "Compiling module \"%s\" failed.", (*mod)->name);
+
/* remove the module itself from the context and free it */
ly_set_rm(&ctx.ctx->list, *mod, NULL);
lys_module_free(*mod, NULL);