[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

TimeoutError in Net::HTTP get and post

Carl Youngblood

9/22/2003 1:45:00 PM

I'm trying to rescue a TimeoutError in Net::HTTP's get and post methods,
but it's not working. I noticed some postings about how the rescue
catch-all didn't work any more for TimeoutErrors, but I can't even
explicitly rescue this error. I know the page is available and that
retrying will work, in this case, and all I want is a quick and dirty
way of scraping some web pages, but this error brings down my script.
Here's my code:

begin
resp, data = h.post('/tsd_listings/tsd_search.fpl', postdata, headers)
rescue TimeoutError => e
retry
end

Thanks in advance for your help.

Carl Youngblood

P.S. I'm using Ruby 1.8.0

1 Answer

Carl Youngblood

9/23/2003 11:22:00 PM

0

Was this just a stupid question or does nobody know the answer? Or
another option I guess would be that everyone is too busy.

Carl Youngblood wrote:
> I''m trying to rescue a TimeoutError in Net::HTTP''s get and post methods,
> but it''s not working. I noticed some postings about how the rescue
> catch-all didn''t work any more for TimeoutErrors, but I can''t even
> explicitly rescue this error. I know the page is available and that
> retrying will work, in this case, and all I want is a quick and dirty
> way of scraping some web pages, but this error brings down my script.
> Here''s my code:
>
> begin
> resp, data = h.post(''/tsd_listings/tsd_search.fpl'', postdata, headers)
> rescue TimeoutError => e
> retry
> end
>
> Thanks in advance for your help.
>
> Carl Youngblood
>
> P.S. I''m using Ruby 1.8.0
>