summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhar Hrachyshka <ihrachys@redhat.com>2014-07-29 17:25:24 +0200
committerIhar Hrachyshka <ihrachys@redhat.com>2014-08-23 21:34:13 +0200
commitbe1dd6730a4ba621b4fb9db1b2717fb36960469f (patch)
treeb75dea9529dc248fc288adf58e9ee62f803fa1c2
parentfeb0c15aee33e98d20c070c059255c0cca3fe641 (diff)
downloadsqalchemy-migrate-be1dd6730a4ba621b4fb9db1b2717fb36960469f.tar.gz
Make sure we don't throw away exception on SQL script failure
If SQL script failed, we don't currently log the failure anywhere, so users have hard time debugging an issue, if anything arises. Let's log the failure before proceeding with rollback. Change-Id: Ic92b1403c00bb238a68265a15150a4be6f6b2346
-rw-r--r--migrate/versioning/script/sql.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/migrate/versioning/script/sql.py b/migrate/versioning/script/sql.py
index fdc9e2b..40d628f 100644
--- a/migrate/versioning/script/sql.py
+++ b/migrate/versioning/script/sql.py
@@ -42,7 +42,8 @@ class SqlScript(base.BaseScript):
else:
conn.execute(text)
trans.commit()
- except:
+ except Exception as e:
+ log.error("SQL script %s failed: %s", self.path, e)
trans.rollback()
raise
finally: