Skip to content
This repository was archived by the owner on Nov 7, 2020. It is now read-only.

Commit

Permalink
Prep load sim error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yourcelf committed Apr 21, 2016
1 parent 84bdc02 commit 0c14d17
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/prepare-load-simulator-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function create(callback) {
sessionsOpen: true,
adminProposedSessions: sessionMode === "admin",
randomizedSessions: sessionMode === "randomized",
history: {},
}, {
success: function() { done(null, event); },
error: function() { done(err); }
Expand All @@ -100,7 +101,9 @@ function create(callback) {
return new Promise(function(resolve, reject) {
sess.destroy({success: resolve, error: reject});
});
})).then(function() { done(event); });
}))
.then(function() { done(null, event); });
.catch(function(err) { done(err, event); });
}
},
// Create new sessions
Expand Down Expand Up @@ -170,7 +173,8 @@ function create(callback) {
}
], function(err) {
if (err) {
logger.error(err)
logger.error(err);
callback(err);
} else {
logger.info("Done.");
callback();
Expand Down

0 comments on commit 0c14d17

Please sign in to comment.