climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1523011 - /incubator/climate/trunk/ocw/dataset.py
Date Fri, 13 Sep 2013 16:57:42 GMT
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



Mime
View raw message