[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gallery-checkins
Subject:    [Gallery-checkins] CVS: gallery2/include/classes/GalleryStorage/DatabaseStorage MySqlDatabaseStorage
From:       Bharat Mediratta <bharat () users ! sourceforge ! net>
Date:       2002-05-24 7:50:22
[Download RAW message or body]

Update of /cvsroot/gallery/gallery2/include/classes/GalleryStorage/DatabaseStorage
In directory usw-pr-cvs1:/tmp/cvs-serv23077/classes/GalleryStorage/DatabaseStorage

Modified Files:
	MySqlDatabaseStorage.class 
Log Message:
Modified every occurrence where we return a status code to wrap
the current __FILE__ and __LINE__.  This allows us to generate
a stack trace when an error occurs!  This is *very* useful.
When something goes wrong we can get output like this:

Status: Error (ERROR_NAME_COLLISION)
in include/classes/DataContainer.class at line 172
in include/classes/ImageContainer.class at line 128
in include/test/TestCase/CreatePhotoItem.class at line 33
in include/test/TestCase.class at line 22

The stack trace is accurate to the line where we wrapped the
error, not the exact line that caused the problem.  But, it
should get us close enough to figure out the problem.  



Index: MySqlDatabaseStorage.class
===================================================================
RCS file: /cvsroot/gallery/gallery2/include/classes/GalleryStorage/DatabaseStorage/MySqlDatabaseStorage.class,v
 retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MySqlDatabaseStorage.class	23 May 2002 06:59:25 -0000	1.2
+++ MySqlDatabaseStorage.class	24 May 2002 07:50:20 -0000	1.3
@@ -58,14 +58,14 @@
 
 	$ret = $this->_initDatabaseSchema();
 	if ($ret->isError()) {
-	    return $ret;
+	    return $ret->wrap(__FILE__, __LINE__);
 	}
 	
 	$this->_traceStart();
 	$ret = $this->_databaseSchema->createSchema();
 	$this->_traceStop();
 
-	return $ret;
+	return $ret->wrap(__FILE__, __LINE__);
     }
 
     /**
@@ -94,7 +94,7 @@
 	}
 
 	$this->_traceStop();
-	return $ret;
+	return $ret->wrap(__FILE__, __LINE__);
     }
 
     /**
@@ -115,7 +115,7 @@
 	}
 
 	$this->_traceStop();
-	return $ret;
+	return $ret->wrap(__FILE__, __LINE__);
     }
 }
 ?>


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

__[ g a l l e r y - c h e c k i n s ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic