incubator-alois-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fla...@apache.org
Subject svn commit: r1040563 - /incubator/alois/trunk/rails/app/helpers/survey_helper.rb
Date Tue, 30 Nov 2010 15:04:30 GMT
Author: flavio
Date: Tue Nov 30 15:04:30 2010
New Revision: 1040563

URL: http://svn.apache.org/viewvc?rev=1040563&view=rev
Log:
Catch exception if iprange finding raises error

Modified:
    incubator/alois/trunk/rails/app/helpers/survey_helper.rb

Modified: incubator/alois/trunk/rails/app/helpers/survey_helper.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/helpers/survey_helper.rb?rev=1040563&r1=1040562&r2=1040563&view=diff
==============================================================================
--- incubator/alois/trunk/rails/app/helpers/survey_helper.rb (original)
+++ incubator/alois/trunk/rails/app/helpers/survey_helper.rb Tue Nov 30 15:04:30 2010
@@ -223,15 +223,21 @@ module SurveyHelper
   ## #end
 
   def format_column(record,column, index)
-    ret = ""
     val = record.send(column.name)
     hash = "#{val}_#{column.name}_#{index}".hash.abs
     if !val.nil? and val.class == String
       sub_num = 0
       val.gsub(/\d+\.\d+\.\d+\.\d+/) {|v|
+        ret = ""
 	sub_num += 1
 	table_id = "ip_#{hash}_#{sub_num}"
-	ranges = IpRange.find_including_range(v)	
+        
+        ranges = []
+	begin
+          ranges = IpRange.find_including_range(v)	
+        rescue
+          $log.warn("Error finding ranges #{$!}")
+        end
 	ip = v.to_ip
 	
 	if ranges.length > 0



Mime
View raw message