Commit d1078127d16dac3515d06e6e6b89c175befc44ac

Authored by Moises Machado
Committed by Antonio Terceiro
1 parent 96c2db0e

ActionItem1049: feed error to stderr

log feed errors to stderr instead of rails logger
Showing 1 changed file with 2 additions and 6 deletions   Show diff stats
script/feed-updater
@@ -6,13 +6,9 @@ require File.dirname(__FILE__) + '/../config/environment' @@ -6,13 +6,9 @@ require File.dirname(__FILE__) + '/../config/environment'
6 begin 6 begin
7 handler = FeedHandler.new 7 handler = FeedHandler.new
8 handler.process(container) 8 handler.process(container)
9 - RAILS_DEFAULT_LOGGER.info("%s ID %d fetched at %s" % [container.class.name, container.id, container.fetched_at])  
10 - rescue FeedHandler::ParseError => ex  
11 - RAILS_DEFAULT_LOGGER.warn("Error parsing content from %s ID %d\n%s" % [container.class.name, container.id, ex.to_s])  
12 - rescue FeedHandler::FetchError => ex  
13 - RAILS_DEFAULT_LOGGER.warn("Error fetching content from %s ID %d\n%s" % [container.class.name, container.id, ex.to_s])  
14 rescue Exception => ex 9 rescue Exception => ex
15 - RAILS_DEFAULT_LOGGER.warn("Unknown error from %s ID %d\n%s" % [container.class.name, container.id, ex.to_s]) 10 + $stderr.puts("Unknown error from %s ID %d\n%s" % [container.class.name, container.id, ex.to_s])
  11 + $stderr.puts("Backtrace:\n%s" % ex.backtrace.join("\n"))
16 end 12 end
17 end 13 end
18 end 14 end