Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EFEE210BF3 for ; Fri, 13 Sep 2013 16:58:05 +0000 (UTC) Received: (qmail 53566 invoked by uid 500); 13 Sep 2013 16:58:05 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 53537 invoked by uid 500); 13 Sep 2013 16:58:05 -0000 Mailing-List: contact commits-help@climate.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.incubator.apache.org Delivered-To: mailing list commits@climate.incubator.apache.org Received: (qmail 53530 invoked by uid 99); 13 Sep 2013 16:58:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Sep 2013 16:58:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 13 Sep 2013 16:58:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C344A23889EC; Fri, 13 Sep 2013 16:57:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1523011 - /incubator/climate/trunk/ocw/dataset.py Date: Fri, 13 Sep 2013 16:57:42 -0000 To: commits@climate.incubator.apache.org From: joyce@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130913165742.C344A23889EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: joyce Date: Fri Sep 13 16:57:42 2013 New Revision: 1523011 URL: http://svn.apache.org/r1523011 Log: CLIMATE-296 - Improve dataset module logging - Log all exceptions in the dataset module. - Minor changes to exception messages in Bounds class which should hopefully provide additional error information. Modified: incubator/climate/trunk/ocw/dataset.py Modified: incubator/climate/trunk/ocw/dataset.py URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw/dataset.py?rev=1523011&r1=1523010&r2=1523011&view=diff ============================================================================== --- incubator/climate/trunk/ocw/dataset.py (original) +++ incubator/climate/trunk/ocw/dataset.py Fri Sep 13 16:57:42 2013 @@ -226,7 +226,9 @@ class Bounds(object): @lat_min.setter def lat_min(self, value): if not (-90 <= value <= 90 and value < self._lat_max): - raise ValueError("Attempted to set lat_min to invalid value.") + error = "Attempted to set lat_min to invalid value: %d" % (value) + logger.error(error) + raise ValueError(error) self._lat_min = value @@ -237,7 +239,9 @@ class Bounds(object): @lat_max.setter def lat_max(self, value): if not (-90 <= value <= 90 and value > self._lat_min): - raise ValueError("Attempted to set lat_max to invalid value.") + error = "Attempted to set lat_max to invalid value: %d" % (value) + logger.error(error) + raise ValueError(error) self._lat_max = value @@ -248,7 +252,9 @@ class Bounds(object): @lon_min.setter def lon_min(self, value): if not (-180 <= value <= 180 and value < self._lon_max): - raise ValueError("Attempted to set lon_min to invalid value.") + error = "Attempted to set lon_min to invalid value: %d" % (value) + logger.error(error) + raise ValueError(error) self._lon_min = value @@ -259,7 +265,9 @@ class Bounds(object): @lon_max.setter def lon_max(self, value): if not (-180 <= value <= 180 and value > self._lon_min): - raise ValueError("Attempted to set lon_max to invalid value.") + error = "Attempter to set lon_max to invalid value: %d" % (value) + logger.error(error) + raise ValueError(error) self._lon_max = value @@ -270,7 +278,9 @@ class Bounds(object): @start.setter def start(self, value): if not (type(value) is dt.datetime and value < self._end): - raise ValueError("Attempted to set start to invalid value") + error = "Attempted to set start to invalid value: %d" % (value) + logger.error(error) + raise ValueError(error) self._start = value @@ -281,6 +291,8 @@ class Bounds(object): @end.setter def end(self, value): if not (type(value) is dt.datetime and value > self._start): - raise ValueError("Attempted to set end to invalid value") + error = "Attempted to set end to invalid value: %d" % (value) + logger.error(error) + raise ValueError(error) self._end = value