Browse Source

pygrass: improve error message on column type

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63207 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 10 years ago
parent
commit
eb055760b9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib/python/pygrass/vector/table.py

+ 3 - 2
lib/python/pygrass/vector/table.py

@@ -407,8 +407,9 @@ class Columns(object):
             valid_type = ('DOUBLE PRECISION', 'DOUBLE', 'INT', 'INTEGER',
                           'DATE')
             if 'VARCHAR' in col_type or col_type.upper() not in valid_type:
-                str_err = "Type is not supported, supported types are: %s"
-                raise TypeError(str_err % ", ".join(valid_type))
+                str_err = ("Type: %r is not supported."
+                           "\nSupported types are: %s")
+                raise TypeError(str_err % (col_type, ", ".join(valid_type)))
             return col_type
 
         col_type = ([check(col_type), ] if isinstance(col_type, (str, unicode))