ECC-1253: GRIB2: Error when setting localDefinitionNumber (centre=98)

This commit is contained in:
Shahram Najm 2021-06-11 14:26:02 +01:00
parent cabb2d54bb
commit 02b25b085f
1 changed files with 7 additions and 1 deletions

View File

@ -333,8 +333,14 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
break;
default:
grib_context_log(a->context, GRIB_LOG_ERROR, "Invalid localDefinitionNumber %d", localDefinitionNumber);
#ifdef DEBUG
/* In test & development mode, fail so we remember to adjust PDTN */
grib_context_log(a->context, GRIB_LOG_ERROR,
"grib_accessor_local_definition: Invalid localDefinitionNumber %d", localDefinitionNumber);
return GRIB_ENCODING_ERROR;
#endif
/* ECC-1253: Do not fail in operations. Leave PDTN as is */
productDefinitionTemplateNumberNew = productDefinitionTemplateNumber;
break;
}