diff --git a/hapi/src/config/index.js b/hapi/src/config/index.js index 8fb20894..b16a5106 100644 --- a/hapi/src/config/index.js +++ b/hapi/src/config/index.js @@ -1,7 +1,16 @@ const massive = require('massive') const massiveConfig = require('./server.config') -const massiveDB = (async () => await massive(massiveConfig))() +const massiveDB = (async () => { + try { + return await massive(massiveConfig) + } catch (err) { + console.log('---- Failed to connect to database ----') + console.log(err) + + return null + } +})() module.exports = { massiveConfig,