Skip to content

Commit

Permalink
Error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 27, 2023
1 parent 2c26f89 commit 7aef2d8
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/grib_accessor_class_bufr_elements_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/grib_accessor_class_data_dummy_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/grib_accessor_class_data_g1simple_packing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/grib_accessor_class_data_simple_packing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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; */
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/grib_accessor_class_dictionary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/grib_accessor_class_gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/grib_accessor_class_julian_date.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/grib_accessor_class_raw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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, &sectionLength);

Expand Down
2 changes: 1 addition & 1 deletion src/grib_accessor_class_variable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/grib_ecc-1170.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7aef2d8

Please sign in to comment.