From b9c5899e288c846dee1d8cc64252343c1a6db39f Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 26 Jul 2022 15:28:34 -0600 Subject: [PATCH] Per #2211, enhance warning/error messages when parsing threshold types in dictionary.cc. --- src/basic/vx_config/dictionary.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/basic/vx_config/dictionary.cc b/src/basic/vx_config/dictionary.cc index a4e5473143..08dc1f7fe9 100644 --- a/src/basic/vx_config/dictionary.cc +++ b/src/basic/vx_config/dictionary.cc @@ -1949,7 +1949,8 @@ if ( Entry ) { mlog << Warning << "\nDictionary::lookup_thresh() -> " - << "threshold lookup failed for name \"" << name << "\"\n\n"; + << "threshold lookup failed for name \"" + << name << "\"\n\n"; } } @@ -1962,7 +1963,9 @@ if ( !Entry || !is_correct_type ) { mlog << Error << "\nDictionary::lookup_thresh() -> " - << "lookup failed for name \"" << name << "\"\n\n"; + << "threshold \"" << name + << "\" must start with a valid comparison operator " + << "(<, <=, ==, !=, >, >=, lt, le, eq, ne, gt, ge).\n\n"; exit ( 1 ); @@ -2008,7 +2011,6 @@ if ( Entry ) { } } - LastLookupStatus = is_correct_type; if ( !Entry || !is_correct_type ) { @@ -2017,7 +2019,9 @@ if ( !Entry || !is_correct_type ) { mlog << Error << "\nDictionary::lookup_thresh_array() -> " - << "lookup failed for name \"" << name << "\"\n\n"; + << "each threshold in array \"" << name + << "\" must start with a valid comparison operator " + << "(<, <=, ==, !=, >, >=, lt, le, eq, ne, gt, ge).\n\n"; exit ( 1 ); @@ -2056,8 +2060,9 @@ if ( Dict->n_entries() > 0 ) { mlog << Error << "\nDictionary::lookup_thresh_array() -> " - << "array \"" << name - << "\" does not contain ThreshType.\n\n"; + << "each threshold in array \"" << name + << "\" must start with a valid comparison operator " + << "(<, <=, ==, !=, >, >=, lt, le, eq, ne, gt, ge).\n\n"; exit ( 1 );