Skip to content

Commit 09ab338

Browse files
committed
Fix backtrace test for Ruby 3.4 format
...Also log exception class in scraper log
1 parent 002c8b2 commit 09ab338

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/scraper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def run
8787
# --- finished
8888
log t('scraper.messages.status', status: 'finish'), 0
8989
rescue StandardError => e
90-
log " Run Scraper failed with: #{e.message}", 0
90+
log " Run Scraper failed with: #{e.message} (#{e.class.name})", 0
9191
e.backtrace.each do |line|
9292
log " #{line}", 0
9393
end

test/unit/ingestors/scraper_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ def run
225225
scraper.run
226226
end
227227

228-
assert logfile_contains(logfile, 'Run Scraper failed with')
229-
assert logfile_contains(logfile, 'in `block in run')
230-
assert logfile_contains(logfile, 'in `map')
231-
assert logfile_contains(logfile, 'in `run')
228+
assert logfile_contains(logfile, 'Run Scraper failed with: unknown attribute')
229+
assert logfile_contains(logfile, "in 'block in Scraper#run'")
230+
assert logfile_contains(logfile, "in 'Array#map'")
231+
assert logfile_contains(logfile, "in 'Scraper#run'")
232232
end
233233

234234
test 'does not scrape disabled or unapproved sources' do

0 commit comments

Comments
 (0)