From ffb2c3380f825f3077352b42909e76b56525e6c1 Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Wed, 9 Nov 2016 16:26:34 -0600 Subject: [PATCH] Add some more debugging to Database:__init__ Preserve some history as to why this code is like what it is. Change-Id: I49e023348996a1ebdf46aeda030511e92efc6223 --- molteniron/moltenirond.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/molteniron/moltenirond.py b/molteniron/moltenirond.py index de2c950..5010f10 100755 --- a/molteniron/moltenirond.py +++ b/molteniron/moltenirond.py @@ -314,9 +314,15 @@ class DataBase(object): c = engine.connect() c.close() except (OperationalError, InternalError) as e: + if DEBUG: + print("Database:__init__: Caught %s" % (e, )) + # engine.connect will throw sqlalchemy.exc exception if isinstance(e, InternalError): (num, msg) = e.orig.args + if DEBUG: + print("Database:__init__: (%d,%s)" % (num, msg, )) if num != 1049 or msg != "Unknown database 'MoltenIron'": + # If it is not the above then reraise it! raise # It does not! Create it. # CREATE DATABASE MoltenIron;