mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
🐛 Fixed EADDRINUSE error handling on NodeJS >=13 (#12591)
closes https://github.com/TryGhost/Ghost#12562 - From NodeJS v13 `error.errno` returns error code instead of a string. Because of that use friendly "port is already in use" message did not work anymore. - Changed to use `error.code` which acts the same way as `error.errno` in older NodeJS versions.
This commit is contained in:
parent
66fe678cb7
commit
ba1ffb7b5f
@ -82,7 +82,7 @@ class GhostServer {
|
||||
self.httpServer.on('error', function (error) {
|
||||
let ghostError;
|
||||
|
||||
if (error.errno === 'EADDRINUSE') {
|
||||
if (error.code === 'EADDRINUSE') {
|
||||
ghostError = new errors.GhostError({
|
||||
message: i18n.t('errors.httpServer.addressInUse.error'),
|
||||
context: i18n.t('errors.httpServer.addressInUse.context', {port: config.get('server').port}),
|
||||
|
Loading…
Reference in New Issue
Block a user