commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/reports/src GREngine.py GRExceptions.py GR...


From: Jason Cater
Subject: gnue/reports/src GREngine.py GRExceptions.py GR...
Date: Fri, 19 Oct 2001 15:02:28 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/10/19 15:02:27

Modified files:
        reports/src    : GREngine.py GRExceptions.py GRRun.py 

Log message:
        added slightly more useful error information than a stack trace for 
user errors

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GREngine.py.diff?cvsroot=OldCVS&tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRExceptions.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRRun.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/reports/src/GREngine.py
diff -u gnue/reports/src/GREngine.py:1.7 gnue/reports/src/GREngine.py:1.8
--- gnue/reports/src/GREngine.py:1.7    Thu Oct 18 19:23:10 2001
+++ gnue/reports/src/GREngine.py        Fri Oct 19 15:02:27 2001
@@ -33,6 +33,7 @@
 import urllib
 import GRReport
 import GRParser
+import GRExceptions
 from gnue.common import openResource, GDebug
 
 
@@ -51,13 +52,19 @@
                           omitGNUeXML=0): 
 
 
-    fileHandle = openResource(reportFile)
+    try: 
+      fileHandle = openResource(reportFile)
 
-    report = GRParser.loadReport(fileHandle, self._connectionManager)
+      report = GRParser.loadReport(fileHandle, self._connectionManager)
 
-    report.process(outputHandle, parameters, sortoption, \
-                   includeStructuralComments=includeStructuralComments, 
-                   omitGNUeXML=omitGNUeXML)
+      report.process(outputHandle, parameters, sortoption, \
+                     includeStructuralComments=includeStructuralComments, 
+                     omitGNUeXML=omitGNUeXML)
+
+    except IOError, msg: 
+      raise GRExceptions.ReportUnreadable, \
+         "Unable to read the requested report definition\n  (%s)\n\n" % 
reportFile \
+         + "Additional Information:\n  %s" % msg
 
     GDebug.printMesg(999, '-'*60)
     GDebug.printMesg(999, report.dumpXML(1))
Index: gnue/reports/src/GRExceptions.py
diff -u gnue/reports/src/GRExceptions.py:1.2 
gnue/reports/src/GRExceptions.py:1.3
--- gnue/reports/src/GRExceptions.py:1.2        Tue May 29 22:19:49 2001
+++ gnue/reports/src/GRExceptions.py    Fri Oct 19 15:02:27 2001
@@ -40,6 +40,14 @@
 
 ############################################################
 #
+# Raised if unable to read the report definition
+#
+class ReportUnreadable(ReportException): 
+  pass
+
+
+############################################################
+#
 #  All exceptions related to an invalid report definition 
 #  descend from ReportException
 #
Index: gnue/reports/src/GRRun.py
diff -u gnue/reports/src/GRRun.py:1.2 gnue/reports/src/GRRun.py:1.3
--- gnue/reports/src/GRRun.py:1.2       Thu Oct 18 19:23:10 2001
+++ gnue/reports/src/GRRun.py   Fri Oct 19 15:02:27 2001
@@ -33,6 +33,7 @@
 from gnue.common import GDebug
 from gnue.common.GClientApp import GClientApp 
 from GREngine import GREngine
+import GRExceptions
 import string
 
 
@@ -160,10 +161,15 @@
 
     
 
-    GREngine(self.getConnectionManager()).processReport(reportfile, \
-        parameters=userParameters, sortoption=sortoption, \
-        includeStructuralComments=self.OPTIONS["comment"], 
-        omitGNUeXML=self.OPTIONS["exclude_xml"])
+    try: 
+      GREngine(self.getConnectionManager()).processReport(reportfile, \
+          parameters=userParameters, sortoption=sortoption, \
+          includeStructuralComments=self.OPTIONS["comment"], 
+          omitGNUeXML=self.OPTIONS["exclude_xml"])
+    except GRExceptions.ReportMarkupException, msg: 
+      self.handleStartupError (msg)
+    except GRExceptions.ReportUnreadable, msg: 
+      self.handleStartupError (msg)
 
 
 #



reply via email to

[Prev in Thread] Current Thread [Next in Thread]