From ae2ce9a1f930f531de158eb767d77936876eff42 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 13 Jan 2015 11:57:50 -0800 Subject: [PATCH] Log raw load settings when parsing fails --- static/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/static/index.js b/static/index.js index c9be97db7..728e47cd1 100644 --- a/static/index.js +++ b/static/index.js @@ -23,7 +23,14 @@ window.onload = function() { }; // Skip "?loadSettings=". - var loadSettings = JSON.parse(decodeURIComponent(location.search.substr(14))); + var rawLoadSettings = decodeURIComponent(location.search.substr(14)); + var loadSettings; + try { + loadSettings = JSON.parse(rawLoadSettings); + } catch (error) { + console.error("Failed to parse load settings: " + rawLoadSettings); + throw error; + } // Normalize to make sure drive letter case is consistent on Windows process.resourcesPath = path.normalize(process.resourcesPath);