Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixes #387

* add module Redmine::I18n
* skip to fetch if project was deleted. (hudson settings remain)
  • Loading branch information...
commit 3b21da5f9f0d136401c3c7aeeb3acce139f71f2c 1 parent 9fe977f
authored
4  app/models/hudson.rb
@@ -122,11 +122,13 @@ def Hudson.find(*args)
122 122
     when :all   then
123 123
       retval = []
124 124
       HudsonSettings.find(*args).each do |settings|
  125
+        next unless Project.find_by_id(settings.project_id)
125 126
         retval << Hudson.new(settings.project_id)
126 127
       end
127 128
       return retval
128 129
     else
129 130
       settings = HudsonSettings.find(*args)
  131
+      return nil unless Project.find_by_id(settings.project_id)
130 132
       retval = Hudson.new(settings.project_id)
131 133
       return retval
132 134
   end
@@ -143,7 +145,7 @@ def Hudson.fetch
143 145
     hudson.fetch
144 146
     next if hudson.hudson_api_errors.empty?
145 147
     hudson.hudson_api_errors.each do |error|
146  
-      $stderr.print "redmine_hudson: #{hudson.project.name}(#{hudson.settings.api_url}) #{error.class_name}:#{error.method_name} #{error.exception.message}\n"
  148
+      $stderr.print "redmine_hudson: #{hudson.project.name}(#{hudson.settings.url_for(:plugin)}) #{error.class_name}:#{error.method_name} #{error.exception.message}\n"
147 149
     end
148 150
   end
149 151
 end
1  app/models/hudson_exceptions.rb
@@ -13,6 +13,7 @@ class HudsonApiException < Exception
13 13
 
14 14
   include ApplicationHelper
15 15
   include ActionView::Helpers::TextHelper
  16
+  include Redmine::I18n if RedmineHudson::RedmineExt.redmine_090_or_higher?
16 17
   
17 18
   def initialize( object )
18 19
     @code = ""

0 notes on commit 3b21da5

Please sign in to comment.
Something went wrong with that request. Please try again.