mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
11987: remove rescue StandardError from controller
This commit is contained in:
@@ -70,17 +70,16 @@ module Admin
|
||||
|
||||
def clone
|
||||
@product = Spree::Product.find(params[:id])
|
||||
@cloned_product = @product.duplicate
|
||||
|
||||
status = :ok
|
||||
|
||||
begin
|
||||
@cloned_product = @product.duplicate
|
||||
if @cloned_product.persisted?
|
||||
flash.now[:success] = t('.success')
|
||||
|
||||
@product_index = "-#{@cloned_product.id}"
|
||||
@producer_options = producers
|
||||
@category_options = categories
|
||||
@tax_category_options = tax_category_options
|
||||
rescue StandardError => _e
|
||||
else
|
||||
flash.now[:error] = t('.error')
|
||||
status = :internal_server_error
|
||||
@product_index = "-1" # Create a unique enough index
|
||||
|
||||
Reference in New Issue
Block a user