diff --git a/packages/models/index.js b/packages/models/index.js index 58bbeb7..db6b269 100644 --- a/packages/models/index.js +++ b/packages/models/index.js @@ -6,14 +6,9 @@ export { default as Session } from './session.js' export { default as Command } from './command.js' export default async function connectDB(uri) { - try { - const db = await mongoose.connect(uri, { - useNewUrlParser: true, - useUnifiedTopology: true, - }) - return db.connection.getClient() - } catch (err) { - console.error(err) - throw new Error('Failed to connect to MongoDB') - } + const db = await mongoose.connect(uri, { + useNewUrlParser: true, + useUnifiedTopology: true, + }) + return db.connection.getClient() }