mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 05:07:05 +00:00
[core] add try / catch on mode_helper loading (#3578)
When a library is missing on an 3rd party module, MM² stop loading and display a black screen. (I'm sure it's happened to everyone.) So, I have added a try/catch block and it's avoid black screen, display errors and allow continue loading with next module
This commit is contained in:
committed by
GitHub
parent
f51fbe39c4
commit
961bae637c
@@ -197,7 +197,13 @@ function App () {
|
||||
|
||||
// if the helper was found
|
||||
if (loadHelper) {
|
||||
const Module = require(helperPath);
|
||||
let Module;
|
||||
try {
|
||||
Module = require(helperPath);
|
||||
} catch (e) {
|
||||
Log.error(`Error when loading ${moduleName}:`, e.message);
|
||||
return;
|
||||
}
|
||||
let m = new Module();
|
||||
|
||||
if (m.requiresVersion) {
|
||||
|
Reference in New Issue
Block a user