schemadiff.py
changeset 61 703bba757605
parent 56 94e091c23ebb
child 63 8c7f0a51ba50
--- a/schemadiff.py	Fri Jan 25 17:44:49 2013 +0100
+++ b/schemadiff.py	Fri Jan 25 18:04:17 2013 +0100
@@ -25,16 +25,19 @@
 
         pgd = pgdiff.PgDiff(srcbrowser, dstbrowser)
 
-        if self.args.schema:
-            pgd.filter_schemas(include=self.args.schema)
+        try:
+            if self.args.schema:
+                pgd.filter_schemas(include=self.args.schema)
+
+            if self.args.table:
+                pgd.filter_tables(include=self.args.table)
 
-        if self.args.table:
-            pgd.filter_tables(include=self.args.table)
-
-        if self.args.sql:
-            pgd.print_patch()
-        else:
-            pgd.print_diff()
+            if self.args.sql:
+                pgd.print_patch()
+            else:
+                pgd.print_diff()
+        except pgdiff.PgDiffError as e:
+            print('PgDiff error:', str(e))
 
 
 tool = SchemaDiffTool()