Nigel Henbest wrote:
> require 'yahoofinance'
> 
> tickers = File.new("/home/nigels/financials/symbols")
> tickers.each_line do |ticker|
> 	quotes = YahooFinance::get_standard_quotes( ticker )
> 	quotes.each do |symbol, qt|
> 		...
> 	end
> end
> 
> Occasionally, yahoo will drop requests which results in timeout 
> exceptions. I would like to "catch" the exception and simply continue 
> with the next ticker.

You just need normal exception handling, right?

   tickers = File.new("/home/nigels/financials/symbols")
   tickers.each_line do |ticker|
     begin
       YahooFinance.get_standard_quotes(ticker).each do |symbol, qt|
         # ...
       end
     rescue NameOfError
       # do some nifty stuff
     end
   end

Since you're handling the exceptions within the block, the loop isn't 
interrupted, but will proceed with the next ticker.

I recently proposed a more elegant syntax for rescuing exceptions within 
do/end blocks:

   tickers.each_line do |ticker|
     YahooFinance.get_standard_quotes(ticker).each do |symbol, qt|
       # ...
     end
   rescue NameOfError
     # ...
   end

though that's still up for discussion (I hope)


Cheers,
Daniel