diff --git a/src/log.c b/src/log.c index 45ead6630..f936abfee 100644 --- a/src/log.c +++ b/src/log.c @@ -594,7 +594,6 @@ log_vprintf(const struct ly_ctx *ctx, LY_LOG_LEVEL level, LY_ERR err, LY_VECODE { 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 @@ log_vprintf(const struct ly_ctx *ctx, LY_LOG_LEVEL level, LY_ERR err, LY_VECODE /* 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 b1a0636f6..022689bc4 100644 --- a/src/plugins_types/ipv4_address.c +++ b/src/plugins_types/ipv4_address.c @@ -303,7 +303,7 @@ lyplg_type_print_ipv4_address(const struct ly_ctx *ctx, const struct lyd_value * /* 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 5476c1977..44383067d 100644 --- a/src/plugins_types/ipv4_address_no_zone.c +++ b/src/plugins_types/ipv4_address_no_zone.c @@ -187,7 +187,7 @@ lyplg_type_print_ipv4_address_no_zone(const struct ly_ctx *ctx, const struct lyd /* 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 031bb8fc9..8ddcd183c 100644 --- a/src/plugins_types/ipv6_address.c +++ b/src/plugins_types/ipv6_address.c @@ -306,7 +306,7 @@ lyplg_type_print_ipv6_address(const struct ly_ctx *ctx, const struct lyd_value * /* 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 6b4f0e608..caa2c8f00 100644 --- a/src/plugins_types/ipv6_address_no_zone.c +++ b/src/plugins_types/ipv6_address_no_zone.c @@ -236,7 +236,7 @@ lyplg_type_print_ipv6_address_no_zone(const struct ly_ctx *ctx, const struct lyd /* 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 9d9d2b488..59e045757 100644 --- a/src/tree_schema.c +++ b/src/tree_schema.c @@ -1952,7 +1952,7 @@ lys_parse_in(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, 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 895da558a..195f215ed 100644 --- a/src/xpath.c +++ b/src/xpath.c @@ -4075,9 +4075,9 @@ xpath_deref(struct lyxp_set **args, uint32_t UNUSED(arg_count), struct lyxp_set 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 @@ xpath_deref(struct lyxp_set **args, uint32_t UNUSED(arg_count), struct lyxp_set } 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; }