Added better logging when database connection fails.
This commit is contained in:
parent
395bf0d35e
commit
7242a13e51
@ -182,7 +182,7 @@ Options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
let args = docopt(doc, version = "db-migrate 0.2.0")
|
let args = docopt(doc, version = "db-migrate 0.2.1")
|
||||||
|
|
||||||
let exitErr = proc(msg: string): void =
|
let exitErr = proc(msg: string): void =
|
||||||
fatal("db_migrate: " & msg)
|
fatal("db_migrate: " & msg)
|
||||||
@ -230,7 +230,7 @@ Options:
|
|||||||
let pgConn: DbConn =
|
let pgConn: DbConn =
|
||||||
try: open("", "", "", config.connectionString)
|
try: open("", "", "", config.connectionString)
|
||||||
except DbError:
|
except DbError:
|
||||||
exitErr "Unable to connect to the database."
|
exitErr "Unable to connect to the database: " & getCurrentExceptionMsg()
|
||||||
(DbConn)(nil)
|
(DbConn)(nil)
|
||||||
|
|
||||||
pgConn.createMigrationsTable
|
pgConn.createMigrationsTable
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
bin = @["db_migrate"]
|
bin = @["db_migrate"]
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Simple tool to handle database migrations."
|
description = "Simple tool to handle database migrations."
|
||||||
license = "BSD"
|
license = "BSD"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user