electron-main: Provide a better error message if Seshat isn't installed.

Port https://github.com/vector-im/riot-web/pull/11691
This commit is contained in:
David Baker 2020-02-03 16:19:16 +00:00
parent b622cd8e35
commit b7b9779b65

View File

@ -47,7 +47,11 @@ let Seshat = null;
try {
Seshat = require('matrix-seshat');
} catch (e) {
console.warn("seshat unavailable", e);
if (e.code === "MODULE_NOT_FOUND") {
console.log("Seshat isn't installed, event indexing is disabled.");
} else {
console.warn("Seshat unexpected error:", e);
}
}
// Things we need throughout the file but need to be created