Better error handling for polls imported from phpBB3

This commit is contained in:
Gerhard Schlager 2016-01-13 22:57:57 +01:00
parent bed9135f40
commit 1164129edc
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,8 @@ module ImportScripts::PhpBB3
poll_text = get_poll_text(options, poll)
extracted_poll = extract_default_poll(topic_id, poll_text)
return if extracted_poll.nil?
update_poll(extracted_poll, options, topic_id, poll)
mapped_poll = {
@ -83,6 +85,9 @@ module ImportScripts::PhpBB3
extracted_polls.each do |poll|
return poll if poll['name'] == @default_poll_name
end
puts "Failed to extract poll for topic id #{topic_id}. The poll text is:"
puts poll_text
end
# @param poll [ImportScripts::PhpBB3::Poll]