Wrap admin user creation in a try/catch to provider better info in case of an error
This commit is contained in:
parent
f1a42dfd07
commit
a98192ba57
|
@ -121,15 +121,20 @@ module.exports = server.listen(env.PORT || 0, async () => {
|
||||||
) {
|
) {
|
||||||
const checklist = await getChecklist()
|
const checklist = await getChecklist()
|
||||||
if (!checklist?.adminUser?.checked) {
|
if (!checklist?.adminUser?.checked) {
|
||||||
await createAdminUser(
|
try {
|
||||||
env.BB_ADMIN_USER_EMAIL,
|
await createAdminUser(
|
||||||
env.BB_ADMIN_USER_PASSWORD,
|
env.BB_ADMIN_USER_EMAIL,
|
||||||
"default"
|
env.BB_ADMIN_USER_PASSWORD,
|
||||||
)
|
"default"
|
||||||
console.log(
|
)
|
||||||
"Admin account automatically created for",
|
console.log(
|
||||||
env.BB_ADMIN_USER_EMAIL
|
"Admin account automatically created for",
|
||||||
)
|
env.BB_ADMIN_USER_EMAIL
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
logAlert("Error creating initial admin user. Exiting.", e)
|
||||||
|
shutdown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue