FIX: Regression where a topic rollback would not properly report errors to the client.

This commit is contained in:
Robin Ward
2013-06-07 12:36:37 -04:00
parent 3ae72259a6
commit 1b5ec42173
2 changed files with 21 additions and 2 deletions

View File

@ -131,8 +131,15 @@ class PostCreator
def setup_topic
if @opts[:topic_id].blank?
topic_creator = TopicCreator.new(@user, guardian, @opts)
topic = topic_creator.create
@errors = topic_creator.errors
begin
topic = topic_creator.create
@errors = topic_creator.errors
rescue ActiveRecord::Rollback => ex
# In the event of a rollback, grab the errors from the topic
@errors = topic_creator.errors
raise ex
end
@new_topic = true
else