dabo Commit
Revision 3201
Date: 2007-06-22 11:11:02 -0700 (Fri, 22 Jun 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3201

Changed:
U   trunk/dabo/biz/dBizobj.py

Log:
Handled the NoRecordsException in the bizobj without aborting the process. The 
exception is still passed up to the calling layer so that the caller (usually 
the UI) is aware that there are no records, and can
respond appropriately.


Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py   2007-06-22 18:07:20 UTC (rev 3200)
+++ trunk/dabo/biz/dBizobj.py   2007-06-22 18:11:02 UTC (rev 3201)
@@ -742,6 +742,7 @@
                        currPK = None
 
                # run the requery
+               uiException = None
                cursor = self._CurrentCursor
                try:
                        cursor.requery(params)
@@ -755,6 +756,11 @@
                        # Pass the exception to the UI
                        raise dException.DBQueryException, e
 
+               except dException.NoRecordsException:
+                       # No need to abort the transaction because of this, but
+                       # we still need to pass the exception to the UI
+                       uiException = dException.NoRecordsException
+                       
                except dException.dException, e:
                        # Something failed; reset things.
                        cursor.rollbackTransaction()
@@ -769,6 +775,8 @@
                except dException.NoRecordsException:
                        pass
                self.afterRequery()
+               if uiException:
+                       raise uiException
 
 
        def setChildLinkFilter(self):




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to