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:
parent
25ec0f3f75
commit
31b693da1f
1 changed files with 12 additions and 6 deletions
|
@ -17,13 +17,19 @@ function startGhost(options) {
|
|||
options = options || {};
|
||||
|
||||
bootstrap(options.config).then(function () {
|
||||
var ghost = require('./server');
|
||||
return ghost(options.app).then(deferred.resolve).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.
|
||||
try {
|
||||
var ghost = require('./server');
|
||||
return ghost(options.app)
|
||||
.then(deferred.resolve)
|
||||
.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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
|
|
Loading…
Reference in a new issue