ECC-1783: grib_to_netcdf: No error message when input file has invalid fields

This commit is contained in:
shahramn 2024-03-08 12:07:15 +00:00
parent 13e38aae92
commit 4752afb09e
1 changed files with 9 additions and 1 deletions

View File

@ -4225,7 +4225,15 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil
grib_handle_delete(h);
}
grib_file_close(file->name, 0, &e);
if (e != GRIB_SUCCESS) {
grib_context_log(ctx, GRIB_LOG_ERROR, "%s (message %d)", grib_get_error_message(e), i);
}
int e2 = 0;
grib_file_close(file->name, 0, &e2);
if (e2 != GRIB_SUCCESS) {
grib_context_log(ctx, GRIB_LOG_ERROR, "Failed to close file %s (%s)", file->name, grib_get_error_message(e2));
}
{
/* Now do some checks */