grib_ls -j: print not_found if accessor returns GRIB_NOT_FOUND
@@ -943,10 +943,14 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type
}
if (ret != GRIB_SUCCESS) {
+ if (ret == GRIB_NOT_FOUND) {
+ sprintf(value_str, "not_found");
+ } else {
fprintf(dump_file, "Failed to get value for key %s\n", key_name);
exit(1);
}
}
+}
/* See ECC-707 */
static int fix_for_lsdate_needed(grib_handle* h)
