use try & catch

This commit is contained in:
SrGooglo 2024-05-09 21:36:23 +00:00
parent c4b0fbafea
commit 1542b8982c

View File

@ -126,6 +126,7 @@ async function injectEnvFromInfisical() {
}
async function Boot(main) {
try {
if (!main) {
throw new Error("main class is not defined")
}
@ -146,6 +147,10 @@ async function Boot(main) {
}
return instance
} catch (error) {
console.error(error)
process.exit(1)
}
}
console.log(`[BOOT] Booting in [${global.isProduction ? "production" : "development"}] mode...`)