diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 1fa55e09c..a4ea50565 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -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; }