mirror of https://github.com/espruino/BangleApps
apploader.js: don't hide errors while loading 'noble'
Loading the module can also fail when e.g. compiled against a different Node.js version, don't hide those errors.pull/2120/head
parent
23eb487024
commit
0a7f3abb08
|
@ -16,12 +16,15 @@ var SETTINGS = {
|
|||
};
|
||||
var APPSDIR = __dirname+"/../apps/";
|
||||
var noble;
|
||||
try {
|
||||
noble = require('@abandonware/noble');
|
||||
} catch (e) {}
|
||||
if (!noble) try {
|
||||
noble = require('noble');
|
||||
} catch (e) { }
|
||||
["@abandonware/noble", "noble"].forEach(module => {
|
||||
if (!noble) try {
|
||||
noble = require(module);
|
||||
} catch(e) {
|
||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!noble) {
|
||||
console.log("You need to:")
|
||||
console.log(" npm install @abandonware/noble")
|
||||
|
|
Loading…
Reference in New Issue