mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Handle EADDRINUSE
no ref - Show a human readable message on EADDRINUSE
This commit is contained in:
parent
9c0b203dce
commit
5430e72753
1 changed files with 11 additions and 0 deletions
|
@ -123,6 +123,17 @@ GhostServer.prototype.start = function (externalApp) {
|
|||
);
|
||||
}
|
||||
|
||||
self.httpServer.on('error', function (error) {
|
||||
if (error.errno === 'EADDRINUSE') {
|
||||
console.log('ERROR: Cannot start Ghost. Another program is already using this port (is another Ghost instance already running?)'.red);
|
||||
} else {
|
||||
console.log(
|
||||
'ERROR: There was an error starting your server. '.red,
|
||||
('(Code: ' + error.errno + ')').red
|
||||
);
|
||||
}
|
||||
process.exit(-1);
|
||||
});
|
||||
self.httpServer.on('connection', self.connection.bind(self));
|
||||
self.httpServer.on('listening', function () {
|
||||
self.logStartMessages();
|
||||
|
|
Loading…
Reference in a new issue