Gracefully fail if sqlite3 module fails to load
This commit is contained in:
parent
4f85779e78
commit
0ad9def514
@ -2,10 +2,19 @@
|
|||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fsextra = require("fs-extra");
|
const fsextra = require("fs-extra");
|
||||||
const sqlite3 = require("sqlite3");
|
|
||||||
const Helper = require("../helper");
|
const Helper = require("../helper");
|
||||||
const Msg = require("../models/msg");
|
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 currentSchemaVersion = 1520239200;
|
||||||
|
|
||||||
const schema = [
|
const schema = [
|
||||||
|
Loading…
Reference in New Issue
Block a user