From 8a52d8ed5f91e8b0650cf15b6898925e10919a13 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 3 Dec 2020 15:52:04 -0600 Subject: [PATCH] BURs: remove dead error handling code. This is a 'this should never happen' error. This error is only raised if we add a new bulk update request type and forget to handle it somewhere. --- app/models/bulk_update_request.rb | 5 ----- test/unit/bulk_update_request_test.rb | 4 ---- 2 files changed, 9 deletions(-) diff --git a/app/models/bulk_update_request.rb b/app/models/bulk_update_request.rb index a1d2d5c31..2149b564f 100644 --- a/app/models/bulk_update_request.rb +++ b/app/models/bulk_update_request.rb @@ -72,11 +72,6 @@ class BulkUpdateRequest < ApplicationRecord forum_updater.update("The #{bulk_update_request_link} (forum ##{forum_post.id}) has been approved by @#{approver.name}.") end end - rescue BulkUpdateRequestProcessor::Error => x - self.approver = approver - CurrentUser.scoped(approver) do - forum_updater.update("The #{bulk_update_request_link} (forum ##{forum_post.id}) has failed: #{x}") - end end def create_forum_topic diff --git a/test/unit/bulk_update_request_test.rb b/test/unit/bulk_update_request_test.rb index 4343cbb70..6133e293d 100644 --- a/test/unit/bulk_update_request_test.rb +++ b/test/unit/bulk_update_request_test.rb @@ -458,10 +458,6 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase should "gracefully handle validation errors during approval" do @req.stubs(:update!).raises(BulkUpdateRequestProcessor::Error.new("blah")) - assert_difference("ForumPost.count", 1) do - @req.approve!(@admin) - end - assert_equal("pending", @req.reload.status) end