mirror of https://github.com/ecmwf/eccodes.git
Error messages
This commit is contained in:
parent
2c26f89a13
commit
7aef2d846b
|
@ -207,7 +207,7 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err)
|
|||
}
|
||||
|
||||
if (!filename) {
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "unable to find definition file %s", self->dictionary);
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "Unable to find definition file %s", self->dictionary);
|
||||
if (strlen(masterRecomposed) > 0) grib_context_log(c, GRIB_LOG_DEBUG,"master path=%s", masterRecomposed);
|
||||
if (strlen(localRecomposed) > 0) grib_context_log(c, GRIB_LOG_DEBUG, "local path=%s", localRecomposed);
|
||||
*err = GRIB_FILE_NOT_FOUND;
|
||||
|
|
|
@ -217,7 +217,7 @@ static int value_count(grib_accessor* a, long* numberOfPoints)
|
|||
*numberOfPoints = 0;
|
||||
|
||||
if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints)) != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to get count of %s (%s)", a->name, grib_get_error_message(err));
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to get count of %s (%s)", a->name, grib_get_error_message(err));
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
|
@ -256,7 +256,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len)
|
|||
return GRIB_SUCCESS;
|
||||
break;
|
||||
case GRIB_INVALID_BPV:
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to compute packing parameters. Invalid bits per value");
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to compute packing parameters. Invalid bits per value");
|
||||
return ret;
|
||||
case GRIB_SUCCESS:
|
||||
break;
|
||||
|
|
|
@ -640,7 +640,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
|
|||
if (max == min) {
|
||||
int large_constant_fields = 0;
|
||||
if (grib_get_nearest_smaller_value(gh, self->reference_value, val[0], &reference_value) != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
return GRIB_INTERNAL_ERROR;
|
||||
}
|
||||
if ((err = grib_set_double_internal(gh, self->reference_value, reference_value)) != GRIB_SUCCESS)
|
||||
|
@ -722,7 +722,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
|
|||
return err;
|
||||
if (grib_get_nearest_smaller_value(gh, self->reference_value, min, &reference_value) != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR,
|
||||
"unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
"Unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
return GRIB_INTERNAL_ERROR;
|
||||
}
|
||||
/* divisor=1; */
|
||||
|
@ -737,7 +737,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
|
|||
/* divisor=1; */
|
||||
if (grib_get_nearest_smaller_value(gh, self->reference_value, min, &reference_value) != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR,
|
||||
"unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
"Unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
return GRIB_INTERNAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
|
|||
|
||||
if (grib_get_nearest_smaller_value(gh, self->reference_value,
|
||||
min, &reference_value) != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to find nearest_smaller_value of %g for %s", min, self->reference_value);
|
||||
return GRIB_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ static grib_trie* load_dictionary(grib_accessor* a, int* err)
|
|||
}
|
||||
|
||||
if (!filename) {
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "unable to find def file %s", self->dictionary);
|
||||
grib_context_log(c, GRIB_LOG_ERROR, "Unable to find def file %s", self->dictionary);
|
||||
*err = GRIB_FILE_NOT_FOUND;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -424,7 +424,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
|
|||
len = 1;
|
||||
ret = grib_expression_evaluate_double(hand, e, &dval);
|
||||
if (ret != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as double (from %s)",
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as double (from %s)",
|
||||
a->name, e->cclass->name);
|
||||
return ret;
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
|
|||
len = sizeof(tmp);
|
||||
cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret);
|
||||
if (ret != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as string (from %s)",
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as string (from %s)",
|
||||
a->name, e->cclass->name);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -433,7 +433,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
|
|||
len = 1;
|
||||
ret = grib_expression_evaluate_long(hand, e, &lval);
|
||||
if (ret != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as long", a->name);
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as long", a->name);
|
||||
return ret;
|
||||
}
|
||||
/*if (hand->context->debug)
|
||||
|
@ -454,7 +454,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
|
|||
len = sizeof(tmp);
|
||||
cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret);
|
||||
if (ret != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as string", a->name);
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as string", a->name);
|
||||
return ret;
|
||||
}
|
||||
len = strlen(cval);
|
||||
|
|
|
@ -124,7 +124,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg)
|
|||
e = grib_arguments_get_expression(hand, arg, n++);
|
||||
err = grib_expression_evaluate_long(hand, e, &(self->relativeOffset));
|
||||
if (err)
|
||||
grib_context_log(hand->context, GRIB_LOG_ERROR, "unable to evaluate relativeOffset");
|
||||
grib_context_log(hand->context, GRIB_LOG_ERROR, "Unable to evaluate relativeOffset");
|
||||
|
||||
grib_get_long(hand, self->sectionLength, §ionLength);
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ static void init(grib_accessor* a, const long length, grib_arguments* args)
|
|||
len = sizeof(tmp);
|
||||
p = grib_expression_evaluate_string(hand, expression, tmp, &len, &ret);
|
||||
if (ret != GRIB_SUCCESS) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to evaluate %s as string: %s",
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to evaluate %s as string: %s",
|
||||
a->name, grib_get_error_message(ret));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ set -e
|
|||
[ $status -ne 0 ]
|
||||
|
||||
#cat $tempErr
|
||||
grep -q "unable to set values as double" $tempErr
|
||||
grep -q "Unable to set values as double" $tempErr
|
||||
|
||||
|
||||
# Clean up
|
||||
|
|
Loading…
Reference in New Issue