Merge pull request #2391 from thelounge/xpaw/no-sqlite-crash
Gracefully fail if sqlite3 module fails to load
This commit is contained in:
commit
d22f0344ea
@ -2,10 +2,19 @@
|
||||
|
||||
const path = require("path");
|
||||
const fsextra = require("fs-extra");
|
||||
const sqlite3 = require("sqlite3");
|
||||
const Helper = require("../helper");
|
||||
const Msg = require("../models/msg");
|
||||
|
||||
let sqlite3;
|
||||
|
||||
try {
|
||||
sqlite3 = require("sqlite3");
|
||||
} catch (e) {
|
||||
Helper.config.messageStorage = Helper.config.messageStorage.filter((item) => item !== "sqlite");
|
||||
|
||||
log.error("Unable to load sqlite3 module. You might need to install it manually.");
|
||||
}
|
||||
|
||||
const currentSchemaVersion = 1520239200;
|
||||
|
||||
const schema = [
|
||||
|
Loading…
Reference in New Issue
Block a user