diff --git a/index.js b/index.js index b3096bd..9116c4b 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,12 @@ function loadJS(filePath) { var contents = fs.readFileSync(filePath, {encoding:"utf8"}); var realExports = exports; exports = undefined; - var r = eval(contents); + var r; + try { + r = eval(contents); + } catch (e) { + console.log("ERROR "+e+" while loading "+filePath); + } exports = realExports; // utf8 lib somehow breaks this return r; /* the code below would be better, but it doesn't seem to work when running diff --git a/libs/webrtc-connection.js b/libs/webrtc-connection.js index c953541..03495ff 100644 --- a/libs/webrtc-connection.js +++ b/libs/webrtc-connection.js @@ -93,7 +93,7 @@ if (typeof Peer == "undefined") { } if (typeof Peer == "undefined") { console.log("webrtc-connection: Peer.js not loaded - Remote Connection disabled"); - throw false; + throw "No Peer.js implementation available"; } var peer; // peer.js connection @@ -418,4 +418,4 @@ function webrtcInit(options) { // Fix for running under Node.js if (typeof global != "undefined") - global.webrtcInit = webrtcInit; \ No newline at end of file + global.webrtcInit = webrtcInit; diff --git a/package.json b/package.json index 02d07e0..91d90aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espruino", - "version": "0.1.54", + "version": "0.1.55", "description": "Command Line Interface and library for Communications with Espruino JavaScript Microcontrollers", "main": "index.js", "files": [