From alois-commits-return-42-apmail-incubator-alois-commits-archive=incubator.apache.org@incubator.apache.org Tue Nov 30 15:06:10 2010 Return-Path: Delivered-To: apmail-incubator-alois-commits-archive@minotaur.apache.org Received: (qmail 49207 invoked from network); 30 Nov 2010 15:06:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Nov 2010 15:06:09 -0000 Received: (qmail 56871 invoked by uid 500); 30 Nov 2010 15:06:06 -0000 Delivered-To: apmail-incubator-alois-commits-archive@incubator.apache.org Received: (qmail 56295 invoked by uid 500); 30 Nov 2010 15:06:05 -0000 Mailing-List: contact alois-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: alois-dev@incubator.apache.org Delivered-To: mailing list alois-commits@incubator.apache.org Received: (qmail 56286 invoked by uid 99); 30 Nov 2010 15:06:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Nov 2010 15:06:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Nov 2010 15:06:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 88E30238897F; Tue, 30 Nov 2010 15:04:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1040563 - /incubator/alois/trunk/rails/app/helpers/survey_helper.rb Date: Tue, 30 Nov 2010 15:04:30 -0000 To: alois-commits@incubator.apache.org From: flavio@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101130150430.88E30238897F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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