mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Better error handling for polls imported from phpBB3
This commit is contained in:
parent
bed9135f40
commit
1164129edc
1 changed files with 5 additions and 0 deletions
|
@ -22,6 +22,8 @@ module ImportScripts::PhpBB3
|
||||||
poll_text = get_poll_text(options, poll)
|
poll_text = get_poll_text(options, poll)
|
||||||
extracted_poll = extract_default_poll(topic_id, poll_text)
|
extracted_poll = extract_default_poll(topic_id, poll_text)
|
||||||
|
|
||||||
|
return if extracted_poll.nil?
|
||||||
|
|
||||||
update_poll(extracted_poll, options, topic_id, poll)
|
update_poll(extracted_poll, options, topic_id, poll)
|
||||||
|
|
||||||
mapped_poll = {
|
mapped_poll = {
|
||||||
|
@ -83,6 +85,9 @@ module ImportScripts::PhpBB3
|
||||||
extracted_polls.each do |poll|
|
extracted_polls.each do |poll|
|
||||||
return poll if poll['name'] == @default_poll_name
|
return poll if poll['name'] == @default_poll_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts "Failed to extract poll for topic id #{topic_id}. The poll text is:"
|
||||||
|
puts poll_text
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param poll [ImportScripts::PhpBB3::Poll]
|
# @param poll [ImportScripts::PhpBB3::Poll]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue