Skip to content

Commit 31b693d

Browse files
committed
Add try-catch to startup
- Should prevent Ghost from exiting without an error message
1 parent 25ec0f3 commit 31b693d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

core/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ function startGhost(options) {
1717
options = options || {};
1818

1919
bootstrap(options.config).then(function () {
20-
var ghost = require('./server');
21-
return ghost(options.app).then(deferred.resolve).otherwise(function (e) {
22-
// We don't return the rejected promise to stop
23-
// the propogation of the rejection and just
24-
// allow the user to manage what to do.
20+
try {
21+
var ghost = require('./server');
22+
return ghost(options.app)
23+
.then(deferred.resolve)
24+
.otherwise(function (e) {
25+
// We don't return the rejected promise to stop
26+
// the propogation of the rejection and just
27+
// allow the user to manage what to do.
28+
deferred.reject(e);
29+
});
30+
} catch (e) {
2531
deferred.reject(e);
26-
});
32+
}
2733
});
2834

2935
return deferred.promise;

0 commit comments

Comments
 (0)