浏览代码

pygrass: Table.execute add values in the exception message

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@66469 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 9 年之前
父节点
当前提交
0d13acb886
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lib/python/pygrass/vector/table.py

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

@@ -1074,9 +1074,10 @@ class Table(object):
             if many and values:
                 return cur.executemany(sqlc, values)
             return cur.execute(sqlc)
-        except Exception, e:
-            #import ipdb; ipdb.set_trace()
-            raise ValueError("The SQL is not correct:\n%r, SQL error: %s" % (sqlc, str(e)))
+        except Exception as exc:
+            raise ValueError("The SQL is not correct:\n%r,\n"
+                             "values: %r,\n"
+                             "SQL error: %s" % (sqlc, values, str(exc)))
 
     def exist(self, cursor=None):
         """Return True if the table already exist in the DB, False otherwise