On 5/30/06, Nigel Henbest <tirins.play / gmail.com> wrote:
> I have a(nother) question concerning exception handling.
>
> Occasionally, yahoo will drop requests which results in timeout
> exceptions. I would like to "catch" the exception and simply continue
> with the next ticker.

require 'yahoofinance'

tickers = File.new("/home/nigels/financials/symbols")
tickers.each_line do |ticker|
  begin
    quotes = YahooFinance::get_standard_quotes( ticker )
    quotes.each do |symbol, qt|
      ...
    end
  rescue
    # Do nothing, just continue with the next ticker.
  end
end

Peace.

  nikolai