]> source.dussan.org Git - redmine.git/commitdiff
Merged r5999 from trunk.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 3 Jun 2011 11:41:34 +0000 (11:41 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 3 Jun 2011 11:41:34 +0000 (11:41 +0000)
scm: catch all exceptions to get scm command version in repository model.

If scm command does not exist,
Linux jruby 1.6.2 (ruby-1.8.7-p330) raises java.io.IOException in production environment.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6000 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index 00d80fb3168d4f6f596b0af56e6ebad5bb7735fb..009854b20fa62cbccfb3251d555e97d2adf5426e 100644 (file)
@@ -276,7 +276,7 @@ class Repository < ActiveRecord::Base
     ret = ""
     begin
       ret = self.scm_adapter_class.client_command if self.scm_adapter_class
-    rescue Redmine::Scm::Adapters::CommandFailed => e
+    rescue Exception => e
       logger.error "scm: error during get command: #{e.message}"
     end
     ret
@@ -286,7 +286,7 @@ class Repository < ActiveRecord::Base
     ret = ""
     begin
       ret = self.scm_adapter_class.client_version_string if self.scm_adapter_class
-    rescue Redmine::Scm::Adapters::CommandFailed => e
+    rescue Exception => e
       logger.error "scm: error during get version string: #{e.message}"
     end
     ret
@@ -296,7 +296,7 @@ class Repository < ActiveRecord::Base
     ret = false
     begin
       ret = self.scm_adapter_class.client_available if self.scm_adapter_class
-    rescue Redmine::Scm::Adapters::CommandFailed => e
+    rescue Exception => e
       logger.error "scm: error during get scm available: #{e.message}"
     end
     ret