Update modules/database.js

This commit is contained in:
2026-09-07 21:59:45 +02:00
parent c23b858f52
commit a84bfb9cf3
+9 -7
View File
@@ -59,20 +59,22 @@ async function runDDL() {
if (sql.trim()) {
logger.log(`Execution of ${file.bold || file}`, ["DDL", "yellow"])
try {
await ddlConn.query(sql)
} catch (error) {
if (error?.fatal) {
logger.error(`Critical error during execution of ${file}: ` + error.message, ["MariaDB", "yellow"])
throw error
}
logger.warn(`Minimal error in ${file} (skipped): ` + error.message, ["MariaDB", "yellow"])
}
}
}
logger.log("MariaDB database successfully initialised!", ["MariaDB", "yellow"])
} catch (error) {
if (error?.fatal) {
logger.error("Critical error during DB initialisation: " + error.message, ["MariaDB", "yellow"])
logger.error(error)
logger.error("DB initialisation aborted: " + error.message, ["MariaDB", "yellow"])
throw error
} else {
logger.warn("Minimal error during DB initialisation: " + error.message, ["MariaDB", "yellow"])
}
} finally {
if (rootConn) {
await rootConn.end()