]> source.dussan.org Git - redmine.git/commitdiff
scm: catch all exceptions to get scm command version in repository model (#8510).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 3 Jun 2011 09:54:57 +0000 (09:54 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 3 Jun 2011 09:54:57 +0000 (09:54 +0000)
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/trunk@5999 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index df64e501e9d12e7dd4de6f8343ba625395ebbd2d..cb05000092c8cf840b36240b7302b0065a3fbc3b 100644 (file)
@@ -278,7 +278,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
@@ -288,7 +288,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
@@ -298,7 +298,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