From b8a4bc64109947c75a57caf802216a5ae3bf9653 Mon Sep 17 00:00:00 2001 From: Jens Kraemer Date: Mon, 15 May 2017 09:17:45 +0800 Subject: [PATCH 2/2] adds rescue from Encoding::UndefinedConversionError --- app/controllers/imports_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index fb87c9b..fcee8cc 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -52,7 +52,7 @@ class ImportsController < ApplicationController rescue CSV::MalformedCSVError => e flash.now[:error] = l(:error_invalid_csv_file_or_settings) - rescue ArgumentError, Encoding::InvalidByteSequenceError => e + rescue ArgumentError, Encoding::InvalidByteSequenceError, Encoding::UndefinedConversionError => e flash.now[:error] = l(:error_invalid_file_encoding, :encoding => ERB::Util.h(@import.settings['encoding'])) rescue SystemCallError => e flash.now[:error] = l(:error_can_not_read_import_file) -- 2.1.4