From 4464d342691caac879e0842bb725fb1f1f48992e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Jan 2020 13:20:02 +0000 Subject: [PATCH] ECC-1060: grib_to_netcdf assertion: 'handle_to_request(r,h) == 0' --- tools/grib_to_netcdf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 88c9f7a3f..7d8c77234 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -610,6 +610,8 @@ static err handle_to_request(request *r, grib_handle* g) strcpy(name, "stepUnits"); if((e = grib_get_string(g, name, value, &len)) == GRIB_SUCCESS) { set_value(r, name, "%s", value); + } else { + grib_context_log(ctx, GRIB_LOG_ERROR, "Cannot get %s as string (%s)", name, grib_get_error_message(e)); } /* @@ -4257,7 +4259,9 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil g = read_field(file, h->offset, length); r = empty_request(""); - Assert(handle_to_request(r,h) == 0); + if (handle_to_request(r,h) != GRIB_SUCCESS) { + grib_context_log(ctx, GRIB_LOG_ERROR, "Failed to convert GRIB handle to a request"); + } /* Keep full MARS description */ /* copy = clone_one_request(r); */