Skip to content

Commit

Permalink
Merge pull request #7908 from minrk/catch-localStorage-failure
Browse files Browse the repository at this point in the history
actually catch failure to load widget state
  • Loading branch information
jdfreder committed Mar 1, 2015
2 parents 6287398 + b6e212f commit a6fd167
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions IPython/html/static/widgets/js/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ define([
// registered.
var that = this;
if (WidgetManager._load_callback) {
Promise.resolve(WidgetManager._load_callback.call(this)).then(function(state) {
Promise.resolve().then(function () {
return WidgetManager._load_callback.call(that);
}).then(function(state) {
that.set_state(state);
}).catch(utils.reject('Error loading widget manager state', true));
}
Expand Down Expand Up @@ -95,7 +97,9 @@ define([
// Use the load callback to immediately load widget states.
WidgetManager._managers.forEach(function(manager) {
if (load_callback) {
Promise.resolve(load_callback.call(manager)).then(function(state) {
Promise.resolve().then(function () {
return load_callback.call(manager);
}).then(function(state) {
manager.set_state(state);
}).catch(utils.reject('Error loading widget manager state', true));
}
Expand Down

0 comments on commit a6fd167

Please sign in to comment.