Add some more debugging to Database:__init__
Preserve some history as to why this code is like what it is. Change-Id: I49e023348996a1ebdf46aeda030511e92efc6223
This commit is contained in:
parent
5f009133dd
commit
ffb2c3380f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue