From fcec0896ce163822fa501e4756979d4a42dec181 Mon Sep 17 00:00:00 2001 From: Pierre Gerold Date: Thu, 21 Apr 2016 11:46:32 +0200 Subject: [PATCH] Protect the three call to custom.js --- notebook/static/edit/js/main.js | 8 +++++++- notebook/static/notebook/js/main.js | 4 ++-- notebook/static/tree/js/main.js | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/notebook/static/edit/js/main.js b/notebook/static/edit/js/main.js index 6286e5db9..f1565ae8d 100644 --- a/notebook/static/edit/js/main.js +++ b/notebook/static/edit/js/main.js @@ -25,7 +25,13 @@ require([ notificationarea ){ "use strict"; - requirejs(['custom/custom'], function() {}); + + try { + requirejs(['custom/custom'], function() {}); + } catch(err) { + console.log("Error loading custom.js from edition service. Continuing and logging"); + console.warn(err); + } page = new page.Page(); diff --git a/notebook/static/notebook/js/main.js b/notebook/static/notebook/js/main.js index fafdd77d5..b1f1485c6 100644 --- a/notebook/static/notebook/js/main.js +++ b/notebook/static/notebook/js/main.js @@ -56,8 +56,8 @@ require([ try{ requirejs(['custom/custom'], function() {}); } catch(err) { - console.warn("Error processing custom.js file. Logging the error and continuing") - console.log(err); + console.log("Error processing custom.js. Logging and continuing") + console.warn(err); } // compat with old IPython, remove for IPython > 3.0 diff --git a/notebook/static/tree/js/main.js b/notebook/static/tree/js/main.js index 5d9eae96d..7513ad5c3 100644 --- a/notebook/static/tree/js/main.js +++ b/notebook/static/tree/js/main.js @@ -30,7 +30,12 @@ require([ newnotebook, loginwidget){ "use strict"; - requirejs(['custom/custom'], function() {}); + try{ + requirejs(['custom/custom'], function() {}); + } catch(err) { + console.log("Error loading custom.js from tree service. Continuing and logging"); + console.warn(err); + } // Setup all of the config related things