pgtoolkit/pgdatacopy.py
changeset 35 e7f79c4a27ce
parent 34 98c7809af415
--- a/pgtoolkit/pgdatacopy.py	Thu May 10 08:42:21 2012 +0200
+++ b/pgtoolkit/pgdatacopy.py	Fri May 11 14:16:36 2012 +0200
@@ -28,7 +28,9 @@
 
 class TargetNotEmptyError(Exception):
     
-    pass
+    def __init__(self, msg, table):
+        Exception.__init__(self, msg)
+        self.table = table
 
 
 class PgDataCopy:
@@ -74,7 +76,7 @@
         curs.execute(q)
         curs.connection.commit()
         if curs.rowcount > 0:
-            raise TargetNotEmptyError('Target table contains data: %s' % self.fulltable2)
+            raise TargetNotEmptyError('Target table contains data.', self.fulltable2)
         self.cols = [desc[0] for desc in curs.description]
     
     def read(self, tmpfile):