NOAA-EMC / UPP

Other
36 stars 98 forks source link

UPP sends invalid empty keys to g2tmpl, and g2tmpl lacks proper error handling #977

Closed SamuelTrahanNOAA closed 3 months ago

SamuelTrahanNOAA commented 3 months ago

When the post xml files lack a field, the post sends an empty string as a key to the g2tmpl library to get the numeric equivalent. The g2tmpl library expects that keys will never be empty, and it lacks error checking to handle invalid keys. Sometimes errors are reported, but the g2tmpl usually won't write anything to the output value. Some of that is invisible to the post because g2tmpl routines call other routines. (For example, the template 4.9 routines will look up the integer values of keys for each field.)

The fix for this is:

  1. UPP sends valid keys.
  2. g2tmpl has reasonable behavior for invalid keys.
  3. g2tmpl reports to UPP if any error that occurs within a subroutine call, not just the last call a subroutine makes.
WenMeng-NOAA commented 3 months ago

This issue was solved in the PR #974.