FW: [globus-python] pyGlobus GSITCP raising exceptions instead of making me dig them out?
Ivan R. Judson
judson at mcs.anl.gov
Tue Jul 13 18:43:47 CDT 2004
So it would appear that the timeout issue will be something that *could* get
fixed if we upgrade Globus, but we'd need windows support, and now OS X
support to make that something we *can* upgrade.
--Ivan
-----Original Message-----
From: Matthew Rodriguez DSD staff [mailto:MKRodriguez at lbl.gov]
Sent: Tuesday, July 13, 2004 5:14 PM
To: judson at mcs.anl.gov
Cc: python-discuss at globus.org
Subject: Re: [globus-python] pyGlobus GSITCP raising exceptions instead of
making me dig them out?
Ivan R. Judson wrote:
>Is there any reason we can't have GSITCPSocket raise real exceptions
>instead of making me use traceback.print_exc()? It feels really wrong
>to be doing
>this:
>
> try:
> bytesRead = childSoc.read(buf, size, size)
> except:
> traceback.print_exc()
>
>When I could be doing something like this:
>
> try:
> bytesRead = childSoc.read(buf, size, size)
> except GlobusException, g:
> log.exception("Error reading socket, details = %s",
>g.globus_error)
>
>Implied in the example is the intention that GlobusException be a new
>derived exception type, that has globus_error filled in with the result
>of getting the last error from the globus layer.
>
>This would make a lot of programming easier.
>
>--Ivan
>
>PS -- We also want a timeout on the GSITCPSocket object, still.
>
>
We'll fix the exceptions so that they have a globus_error member variable
and they'll provide the stack trace as well. That's easy enough.
Regarding setting a timeout on the GSITCPSocket, the globus_io interface
does not provide a way to set a timeout. However the globus_xio interface
does. So for versions of globus that have xio we could give the GSITCPSocket
a settimeout method.
Matt
More information about the ag-dev
mailing list