0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Add try-catch to startup

- Should prevent Ghost from exiting without an error message
This commit is contained in:
Hannah Wolfe 2014-05-11 17:33:18 +01:00
parent 25ec0f3f75
commit 31b693da1f

View file

@ -17,13 +17,19 @@ function startGhost(options) {
options = options || {}; options = options || {};
bootstrap(options.config).then(function () { bootstrap(options.config).then(function () {
var ghost = require('./server'); try {
return ghost(options.app).then(deferred.resolve).otherwise(function (e) { var ghost = require('./server');
// We don't return the rejected promise to stop return ghost(options.app)
// the propogation of the rejection and just .then(deferred.resolve)
// allow the user to manage what to do. .otherwise(function (e) {
// We don't return the rejected promise to stop
// the propogation of the rejection and just
// allow the user to manage what to do.
deferred.reject(e);
});
} catch (e) {
deferred.reject(e); deferred.reject(e);
}); }
}); });
return deferred.promise; return deferred.promise;