mirror of https://github.com/ecmwf/eccodes.git
Use ERROR rather than FATAL
This commit is contained in:
parent
70b2799dcd
commit
a96fe2a661
|
@ -682,10 +682,10 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len)
|
||||||
if (act->default_value != NULL) {
|
if (act->default_value != NULL) {
|
||||||
const char* p = 0;
|
const char* p = 0;
|
||||||
size_t s_len = 1;
|
size_t s_len = 1;
|
||||||
long l;
|
long l = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
double d;
|
double d = 0;
|
||||||
char tmp[1024];
|
char tmp[1024] = {0,};
|
||||||
grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0);
|
grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0);
|
||||||
int type = grib_expression_native_type(grib_handle_of_accessor(a), expression);
|
int type = grib_expression_native_type(grib_handle_of_accessor(a), expression);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -703,8 +703,8 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len)
|
||||||
s_len = sizeof(tmp);
|
s_len = sizeof(tmp);
|
||||||
p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret);
|
p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret);
|
||||||
if (ret != GRIB_SUCCESS) {
|
if (ret != GRIB_SUCCESS) {
|
||||||
grib_context_log(a->context, GRIB_LOG_FATAL,
|
grib_context_log(a->context, GRIB_LOG_ERROR,
|
||||||
"unable to evaluate %s as string", a->name);
|
"%s: Unable to evaluate default value of %s as string expression", __func__, a->name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
s_len = strlen(p) + 1;
|
s_len = strlen(p) + 1;
|
||||||
|
|
Loading…
Reference in New Issue