Module: nagvis
Branch: nagvis-1.4
Commit: 16f3948c667865d41b690d95fd91c7e61c88dbdd
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=16f3948c667865d41b690d95fd91c7e61c88dbdd

Author: Lars Michelsen <[email protected]>
Date:   Wed Sep  2 17:38:10 2009 +0200

#92 Added more verbose error reporting when merging two object states where one 
object has an invalid state

---

 .../classes/objects/NagVisStatefulObject.php       |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/nagvis/nagvis/includes/classes/objects/NagVisStatefulObject.php 
b/nagvis/nagvis/includes/classes/objects/NagVisStatefulObject.php
index b71a439..d3735c3 100644
--- a/nagvis/nagvis/includes/classes/objects/NagVisStatefulObject.php
+++ b/nagvis/nagvis/includes/classes/objects/NagVisStatefulObject.php
@@ -616,6 +616,20 @@ class NagVisStatefulObject extends NagVisObject {
        protected function wrapChildState(&$OBJ) {
                $sSummaryState = $this->getSummaryState();
                $sObjSummaryState = $OBJ->getSummaryState();
+
+               // The state of the compare object is empty: Do not compare!
+               if($sObjSummaryState == '') {
+                       echo "NagVisError: Object state in object 
(".$OBJ->getName().") is empty\n";
+                       exit(1);
+               }
+               
+               // The state of the item to be compared is invalid
+               if(!isset(self::$arrStates[$sObjSummaryState])) {
+                       echo "NagVisError: Invalid object state 
\"".$sObjSummaryState."\" in object (".$OBJ->getName().")\n";
+                       exit(1);
+               }
+               
+               // When this object has no state yet it is not needed to 
compare anything
                if($sSummaryState != '') {
                        /* When the state of the current child is not as good 
as the current
                         * summary state or the state is equal and the 
sub-state differs.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to