You are viewing a plain text version of this content. The canonical link for it is here.
Posted to alois-commits@incubator.apache.org by fl...@apache.org on 2010/11/30 15:04:30 UTC
svn commit: r1040563 -
/incubator/alois/trunk/rails/app/helpers/survey_helper.rb
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