views:

107

answers:

1

I have a function called DownloadData() which uses url.fetch(). From time to time it throws DownloadError: ApplicationError: 2 timed out error.

How can I catch this error? With "except DownloadError: ApplicationError: 2 timed " or only "DownloadError"? It is hard to reproduce this error so I can not know which except to use.

Thanks,

Joel

A: 

Just "except DownloadError:" should work fine. Your second example isn't valid Python, though.

Nick Johnson