Ha. Thanks.
-Ben
On 6/27/07, John Messerly <[EMAIL PROTECTED]> wrote:
> The "stream = args.Result" line in asyncReader is the culprit. The Result
> property will throw if the read operation failed. You could move that line
> inside the try block, so the exception is caught. Or alternatively, u
The "stream = args.Result" line in asyncReader is the culprit. The Result
property will throw if the read operation failed. You could move that line
inside the try block, so the exception is caught. Or alternatively, use the
args.Exception property to determine if there was an error in the read.
Is this a bug or am I doing something wrong?
$ cat webclient.py
import clr
import System
from System import Uri
from System.Net import WebClient, WebException
class Foo:
def __init__(self, uri):
self.setup(uri)
def setup(self, uri):
self.uri = Uri