More detailed misnamed column error in ColumnAccessCommand._get_column
authorW. Trevor King <wking@drexel.edu>
Wed, 11 Aug 2010 22:06:56 +0000 (18:06 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 11 Aug 2010 22:06:56 +0000 (18:06 -0400)
hooke/plugin/curve.py

index 308124b2549fd541a774d9c1a9ba6dbc3eff5931..e5a12aec3dc81971967f0f1920e53f080fca0348 100644 (file)
@@ -161,7 +161,12 @@ class ColumnAccessCommand (BlockCommand):
             column_name = self._column_arguments[0].name
         column_name = params[column_name]
         block = self._block(hooke, params, block_name)
-        column_index = block.info['columns'].index(column_name)
+        columns = block.info['columns']
+        try:
+            column_index = columns.index(column_name)
+        except ValueError, e:
+            raise Failure('%s not in %s (%s): %s'
+                          % (column_name, block.info['name'], columns, e))
         return block[:,column_index]