diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-25 06:50:25 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-25 06:50:25 +0000 |
commit | b0e17e8199bb40d0b1bed2c3dded355f439d8b3a (patch) | |
tree | 694b9ccde636af70a5aa515b62d1020a5eac9e62 /lib/redmine | |
parent | a12b7bcf2931045e63093adcd765d7c6e022fa05 (diff) | |
download | redmine-b0e17e8199bb40d0b1bed2c3dded355f439d8b3a.tar.gz redmine-b0e17e8199bb40d0b1bed2c3dded355f439d8b3a.zip |
Don't rescue Exception class (#31387).
Patch by Go MAEDA and Pavel Rosický.
git-svn-id: http://svn.redmine.org/redmine/trunk@18197 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/plugin.rb | 6 | ||||
-rw-r--r-- | lib/redmine/scm/adapters/abstract_adapter.rb | 8 | ||||
-rw-r--r-- | lib/redmine/scm/adapters/mercurial_adapter.rb | 2 | ||||
-rw-r--r-- | lib/redmine/scm/adapters/subversion_adapter.rb | 2 |
4 files changed, 7 insertions, 11 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index b5fa3d209..998595339 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -422,7 +422,7 @@ module Redmine base_target_dir = File.join(destination, File.dirname(source_files.first).gsub(source, '')) begin FileUtils.mkdir_p(base_target_dir) - rescue Exception => e + rescue => e raise "Could not create directory #{base_target_dir}: " + e.message end end @@ -433,7 +433,7 @@ module Redmine target_dir = File.join(destination, dir.gsub(source, '')) begin FileUtils.mkdir_p(target_dir) - rescue Exception => e + rescue => e raise "Could not create directory #{target_dir}: " + e.message end end @@ -444,7 +444,7 @@ module Redmine unless File.exist?(target) && FileUtils.identical?(file, target) FileUtils.cp(file, target) end - rescue Exception => e + rescue => e raise "Could not copy #{file} to #{target}: " + e.message end end diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index d66f0da25..694273a71 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -247,11 +247,7 @@ module Redmine io.close_write unless options[:write_stdin] block.call(io) if block_given? end - ## If scm command does not exist, - ## Linux JRuby 1.6.2 (ruby-1.8.7-p330) raises java.io.IOException - ## in production environment. - # rescue Errno::ENOENT => e - rescue Exception => e + rescue => e msg = strip_credential(e.message) # The command failed, log it and re-raise logmsg = "SCM command failed, " @@ -282,7 +278,7 @@ module Redmine str.force_encoding(from) begin str.encode(to) - rescue Exception => err + rescue => err logger.error("failed to convert from #{from} to #{to}. #{err}") nil end diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index d5a87f2b3..f882b08cb 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -92,7 +92,7 @@ module Redmine :lastrev => Revision.new(:revision => tip['revision'], :scmid => tip['node'])) # rescue HgCommandAborted - rescue Exception => e + rescue => e logger.error "hg: error during getting info: #{e.message}" nil end diff --git a/lib/redmine/scm/adapters/subversion_adapter.rb b/lib/redmine/scm/adapters/subversion_adapter.rb index 5ee7159c0..ad4d7c281 100644 --- a/lib/redmine/scm/adapters/subversion_adapter.rb +++ b/lib/redmine/scm/adapters/subversion_adapter.rb @@ -115,7 +115,7 @@ module Redmine }) }) end - rescue Exception => e + rescue => e logger.error("Error parsing svn output: #{e.message}") logger.error("Output was:\n #{output}") end |