From c2ce20992dee0a7d1b23f4b5e8cdb870e29e2fcc Mon Sep 17 00:00:00 2001 From: Christian Geddes Date: Tue, 12 Sep 2017 16:26:51 -0500 Subject: Improve error messages for getParent API on TARGETING namespace I see these errors all the time and I always think they could be better Change-Id: I68d796d5ff06783eb1d7122ee66e6403f26a59eb Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46112 Reviewed-by: William G. Hoffa Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Prachi Gupta Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- src/usr/targeting/common/utilFilter.C | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/usr/targeting/common/utilFilter.C') diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C index 928aa64d6..d94f69073 100644 --- a/src/usr/targeting/common/utilFilter.C +++ b/src/usr/targeting/common/utilFilter.C @@ -443,9 +443,13 @@ const Target * getParentChip( const Target * i_pChiplet ) { l_pChip = l_chipList[0]; } + else if (l_chipList.size() == 0) + { + TARG_ERR("Failed to find a parent chip target for huid=%.8X", TARGETING::get_huid(i_pChiplet)); + } else { - TARG_ERR("Number of Parent chip is not 1, but %d | huid=%.8X",l_chipList.size(), TARGETING::get_huid(i_pChiplet)); + TARG_ERR("Found %d parent chip targets for huid=%.8X, expected to only find 1",l_chipList.size(), TARGETING::get_huid(i_pChiplet)); } return l_pChip; @@ -470,9 +474,15 @@ const Target * getParent( const Target * i_unit , TARGETING::TYPE &i_pType) { l_parent = l_chipList[0]; } + else if (l_chipList.size() == 0) + { + TARG_ERR("Failed to find a parent target for huid=%.8X", TARGETING::get_huid(i_unit)); + } else { - TARG_ERR("Number of Parent chip is not 1, but %d",l_chipList.size()); + TARG_ERR("Found %d parent targets for huid=%.8X, only expected to find 1", + l_chipList.size(), + TARGETING::get_huid(i_unit)); } return l_parent; -- cgit v1.2.1