mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: change connect db error handling
This commit is contained in:
1 parent
d3dd12a547
commit
cc9040038d
2 files changed
+7
-3
No files matched your search
@@ -16,7 +16,6 @@ export default async function connectDB(uri) {
|
||||
return db.connection.getClient()
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
return null
|
||||
throw new Error('Failed to connect to MongoDB')
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user