log UPDATE avoid using LY_EVALID without vecode
Refs #2215
diff --git a/src/log.c b/src/log.c
index 45ead66..f936abf 100644
--- a/src/log.c
+++ b/src/log.c
@@ -594,7 +594,6 @@
{
char *msg = NULL;
ly_bool free_strs = 1, lolog, lostore;
- const struct ly_err_item *e;
/* learn effective logger options */
if (temp_ly_log_opts) {
@@ -636,11 +635,6 @@
/* store the error/warning in the context (if we need to store errors internally, it does not matter what are
* the user log options) */
if ((level < LY_LLVRB) && ctx && lostore) {
- if (((err & ~LY_EPLUGIN) == LY_EVALID) && (vecode == LYVE_SUCCESS)) {
- /* assume we are inheriting the error, so inherit vecode as well */
- e = ly_err_last(ctx);
- vecode = e->vecode;
- }
free_strs = 0;
if (log_store(ctx, level, err, vecode, msg, data_path, schema_path, line, apptag ? strdup(apptag) : NULL)) {
goto cleanup;
diff --git a/src/plugins_types/ipv4_address.c b/src/plugins_types/ipv4_address.c
index b1a0636..022689b 100644
--- a/src/plugins_types/ipv4_address.c
+++ b/src/plugins_types/ipv4_address.c
@@ -303,7 +303,7 @@
/* get the address in string */
if (!inet_ntop(AF_INET, &val->addr, ret, INET_ADDRSTRLEN)) {
free(ret);
- LOGERR(ctx, LY_EVALID, "Failed to get IPv4 address in string (%s).", strerror(errno));
+ LOGERR(ctx, LY_ESYS, "Failed to get IPv4 address in string (%s).", strerror(errno));
return NULL;
}
diff --git a/src/plugins_types/ipv4_address_no_zone.c b/src/plugins_types/ipv4_address_no_zone.c
index 5476c19..4438306 100644
--- a/src/plugins_types/ipv4_address_no_zone.c
+++ b/src/plugins_types/ipv4_address_no_zone.c
@@ -187,7 +187,7 @@
/* get the address in string */
if (!inet_ntop(AF_INET, &val->addr, ret, INET_ADDRSTRLEN)) {
free(ret);
- LOGERR(ctx, LY_EVALID, "Failed to get IPv4 address in string (%s).", strerror(errno));
+ LOGERR(ctx, LY_ESYS, "Failed to get IPv4 address in string (%s).", strerror(errno));
return NULL;
}
diff --git a/src/plugins_types/ipv6_address.c b/src/plugins_types/ipv6_address.c
index 031bb8f..8ddcd18 100644
--- a/src/plugins_types/ipv6_address.c
+++ b/src/plugins_types/ipv6_address.c
@@ -306,7 +306,7 @@
/* get the address in string */
if (!inet_ntop(AF_INET6, &val->addr, ret, INET6_ADDRSTRLEN)) {
free(ret);
- LOGERR(ctx, LY_EVALID, "Failed to get IPv6 address in string (%s).", strerror(errno));
+ LOGERR(ctx, LY_ESYS, "Failed to get IPv6 address in string (%s).", strerror(errno));
return NULL;
}
diff --git a/src/plugins_types/ipv6_address_no_zone.c b/src/plugins_types/ipv6_address_no_zone.c
index 6b4f0e6..caa2c8f 100644
--- a/src/plugins_types/ipv6_address_no_zone.c
+++ b/src/plugins_types/ipv6_address_no_zone.c
@@ -236,7 +236,7 @@
/* get the address in string */
if (!inet_ntop(AF_INET6, &val->addr, ret, INET6_ADDRSTRLEN)) {
free(ret);
- LOGERR(ctx, LY_EVALID, "Failed to get IPv6 address in string (%s).", strerror(errno));
+ LOGERR(ctx, LY_ESYS, "Failed to get IPv6 address in string (%s).", strerror(errno));
return NULL;
}
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 9d9d2b4..59e0457 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -1952,7 +1952,7 @@
const struct ly_err_item *e = ly_err_last(ctx);
if (e && (!e->schema_path || e->line)) {
- LOGERR(ctx, ret, "Parsing module \"%s\" failed.", mod->name);
+ LOGERR(ctx, LY_EOTHER, "Parsing module \"%s\" failed.", mod->name);
}
}
}
diff --git a/src/xpath.c b/src/xpath.c
index 895da55..195f215 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -4075,9 +4075,9 @@
r = lyplg_type_resolve_leafref((struct lysc_type_leafref *)sleaf->type, &leaf->node, &leaf->value, set->tree,
&targets, &errmsg);
if (r) {
- LOGERR(set->ctx, LY_EVALID, "%s", errmsg);
+ LOGERR(set->ctx, LY_EINVAL, "%s", errmsg);
free(errmsg);
- ret = LY_EVALID;
+ ret = LY_EINVAL;
goto cleanup;
}
@@ -4088,9 +4088,9 @@
} else {
assert(sleaf->type->basetype == LY_TYPE_INST);
if (ly_path_eval(leaf->value.target, set->tree, NULL, &node)) {
- LOGERR(set->ctx, LY_EVALID, "Invalid instance-identifier \"%s\" value - required instance not found.",
+ LOGERR(set->ctx, LY_EINVAL, "Invalid instance-identifier \"%s\" value - required instance not found.",
lyd_get_value(&leaf->node));
- ret = LY_EVALID;
+ ret = LY_EINVAL;
goto cleanup;
}