From 72d622dc9f38f9a429aee7d86667426cf57337ea Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 27 Feb 2021 07:46:35 +0000 Subject: Display more detailed error message when attempting to import malformed CSV file (#34762). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20756 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/imports_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index d295f5ebc..0e97e06c3 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -55,7 +55,7 @@ class ImportsController < ApplicationController rescue CSV::MalformedCSVError, EncodingError => e if e.is_a?(CSV::MalformedCSVError) && e.message !~ /Invalid byte sequence/ - flash.now[:error] = l(:error_invalid_csv_file_or_settings) + flash.now[:error] = l(:error_invalid_csv_file_or_settings, e.message) else flash.now[:error] = l(:error_invalid_file_encoding, :encoding => ERB::Util.h(@import.settings['encoding'])) end -- cgit v1.2.3