FW: [Bug 17] New: Please raise exceptions instead of strings

Ivan R. Judson judson at mcs.anl.gov
Wed Sep 8 08:17:35 CDT 2004


I'm going to resolve bug # 1054 with this action; I think trying to dig out
every call to pyGLobus and introducing code that works around this problem
and getting that done by the end of the day is asking for trouble and more
new bugs.

I'd rather this was fixed by pyglobus and we can apply that pressure now.

objections?

--Ivan 

-----Original Message-----
From: bugzilla-daemon at george.lbl.gov [mailto:bugzilla-daemon at george.lbl.gov]

Sent: Wednesday, September 08, 2004 8:15 AM
To: judson at mcs.anl.gov
Subject: [Bug 17] New: Please raise exceptions instead of strings

http://www.dsd.lbl.gov/bugzilla/show_bug.cgi?id=17

           Summary: Please raise exceptions instead of strings
           Product: pyGlobus
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: util
        AssignedTo: MKRodriguez at lbl.gov
        ReportedBy: judson at mcs.anl.gov


We'd like pyGlobus to return python error types (exceptions, etc) for calls
down into the lower level software. Having strings come back, and then
having to parse them or make subsequent calls to find the error makes our
code extremely bloated and ugly. It seems like this is something the
pyGlobus wrapper should do. If there are any questions please do email us :)

>From our (AccessGrid) bugzilla (bug #1056)
[http://bugzilla.mcs.anl.gov/accessgrid/show_bug.cgi?id=1056]:

Here is the code.  An exception happens usually when shutting down a
listening socket.  It needs to raise a specific exception instead of a
string so we can catch it.

try:
    self.handle_request()
# This used to work
except GSITCPSocketException:
    log.info("GSIHTTPTransferServer: ... most likely shutting down. ") # At
Least this should work, but it doesn't, since a string was raised.
except Exception, e:
    log.exception("GSIHTTPTransferServer: ... most likely shutting down. ",
e) # This will catch everything, but this is very bad.
#except:
    #log.info("GSIHTTPTransferServer: ... most likely shutting down. ")


Here is the output from stdout:

Exception in thread TransferServer:
Traceback (most recent call last):
  File "/usr/lib/python2.2/threading.py", line 414, in __bootstrap
    self.run()
  File "/usr/lib/python2.2/threading.py", line 402, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "/home/eolson/fl/src/ag/cvs/AccessGrid/AccessGrid/DataStore.py", line
1602, in thread_run
    self.handle_request()
  File "/usr/lib/python2.2/SocketServer.py", line 216, in handle_request
    request, client_address = self.get_request()
  File "/usr/lib/python2.2/site-packages/pyGlobus/io.py", line 846, in
get_request
    raise(str(self.socket) + str(" is having trouble listening!:" + str
(ex.args)))
<pyGlobus.io.GSITCPSocket instance at 0xa4badd4> is having trouble
listening!:('an I/O operation was cancelled',)



------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.





More information about the ag-dev mailing list