diff options
-rwxr-xr-x | lib/options-handler.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/options-handler.js b/lib/options-handler.js index 052e2214b..bebc75483 100755 --- a/lib/options-handler.js +++ b/lib/options-handler.js @@ -286,9 +286,14 @@ export class ClientOptionsHandler { fullData += data; }); res.on('end', () => { - const libsArr = JSON.parse(fullData); + try { + const libsArr = JSON.parse(fullData); - this.remoteLibs[remoteId] = this.libArrayToObject(libsArr); + this.remoteLibs[remoteId] = this.libArrayToObject(libsArr); + } catch (e) { + logger.error('Error while fetching remote libraries, but continuing.', e); + this.remoteLibs[remoteId] = {}; + } resolve(this.remoteLibs[remoteId]); }); |