Bail if unable to connect to db
Noah Zalev committed
Apr 24, 2021 at 17:22 UTC
0612f23b3647a9b89c401d69820618e9e2f9b687
1 file changed
+4
-1
db.js
+4
-1
@@ -467,7 +467,10 @@ module.exports.CreateDB = function (parent, func) {
467
// Set the default database for the rest of this connections lifetime
468
var useDatabase = 'USE ' + dbname;
469
sqlDbQuery(useDatabase, null, function (err, docs) {
470
- if (err != null) { console.log(err); parent.debug('db', 'ERROR: ' + useDatabase + ': ' + err); }
470
+ if (err != null) {
471
+ console.log("Unable to connect to database: " + err);
472
+ process.exit();
473
+ }
474
if (err == null) {
475
parent.debug('db', 'Checking tables...');
476
sqlDbBatchExec([