ECC-1738: BUFR: Better error message for invalid sequence

This commit is contained in:
Shahram Najm 2023-12-21 12:47:26 +00:00
parent 64dfdd9f04
commit c077fa5dc5
3 changed files with 17 additions and 0 deletions

View File

@ -25,6 +25,7 @@
MEMBERS = char* masterDir
MEMBERS = char* localDir
MEMBERS = char* ecmfDir
MEMBERS = char* full_path
MEMBERS = int nofail
END_CLASS_DEF
@ -56,6 +57,7 @@ typedef struct grib_action_hash_array {
char* masterDir;
char* localDir;
char* ecmfDir;
char* full_path;
int nofail;
} grib_action_hash_array;
@ -159,6 +161,8 @@ grib_action* grib_action_create_hash_array(grib_context* context,
else
a->ecmfDir = NULL;
a->full_path = NULL;
if (defaultkey)
act->defaultkey = grib_context_strdup_persistent(context, defaultkey);
@ -296,6 +300,7 @@ static grib_hash_array_value* get_hash_array_impl(grib_handle* h, grib_action* a
self->basename, master, ecmf, local, context->grib_definition_files_path);
return NULL;
}
self->full_path = full;
grib_context_log(h->context, GRIB_LOG_DEBUG,
"Loading hash_array %s from %s", ((grib_action*)self)->name, full);
@ -324,3 +329,9 @@ grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a)
GRIB_MUTEX_UNLOCK(&mutex);
return result;
}
const char* get_hash_array_full_path(grib_action* a)
{
grib_action_hash_array* self = (grib_action_hash_array*)a;
return self->full_path;
}

View File

@ -74,6 +74,7 @@ int get_concept_condition_string(grib_handle* h, const char* key, const char* va
/* action_class_hash_array.cc*/
grib_action* grib_action_create_hash_array(grib_context* context, const char* name, grib_hash_array_value* hash_array, const char* basename, const char* name_space, const char* defaultkey, const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail);
grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a);
const char* get_hash_array_full_path(grib_action* a);
/* action_class_set.cc*/
grib_action* grib_action_create_set(grib_context* context, const char* name, grib_expression* expression, int nofail);

View File

@ -203,6 +203,11 @@ static grib_hash_array_value* find_hash_value(grib_accessor* a, int* err)
grib_context_log(a->context, GRIB_LOG_ERROR,
"hash_array: no match for %s=%s",
a->creator->name, self->key);
const char* full_path = get_hash_array_full_path(a->creator);
if (full_path) {
grib_context_log(a->context, GRIB_LOG_ERROR, "hash_array: file path = %s", full_path);
}
grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Check the key 'masterTablesVersionNumber'");
return NULL;
}
return ha_ret;