History

Instrument FileScraper read errors rather than use puts

Thibaut Courouble committed 8 years ago

Commit 00957791 parent 0725a692 files · +5 −1Browse files

Unified · Split

2 files
  1. lib/docs/core/scrapers/file_scraper.rb +1 −1
  2. lib/docs/subscribers/doc_subscriber.rb +4 −0
lib/docs/core/scrapers/file_scraper.rb+1−1
@@ -41,7 +41,7 @@ module Docs · 40 unmodified lines
4141 def read_file(path)
4242 File.read(path)
4343 rescue
44− puts "Failed to open file: #{path}"
44+ instrument 'warn.doc', msg: "Failed to open file: #{path}"
4545 nil
4646 end
4747 end
lib/docs/subscribers/doc_subscriber.rb+4−0
@@ -26,6 +26,10 @@ module Docs · 25 unmodified lines
2626 log event.payload[:msg]
2727 end
2828
29+ def warn(event)
30+ log "ERROR: #{event.payload[:msg]}"
31+ end
32+
2933 def error(event)
3034 exception = event.payload[:exception]
3135 log "ERROR:"