mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-27 22:59:51 -05:00
catch bind errors
This commit is contained in:
parent
225c2bb65f
commit
503b60a45b
1 changed files with 7 additions and 1 deletions
|
@ -98,7 +98,13 @@ function afterConfigLoad() {
|
|||
logger.setup(config.logs)
|
||||
|
||||
var hostport = get_hostport()
|
||||
server(config).listen(hostport[1], hostport[0])
|
||||
server(config)
|
||||
.listen(hostport[1], hostport[0])
|
||||
.on('error', function(err) {
|
||||
logger.logger.fatal({err: err}, 'cannot create server: @{err.message}')
|
||||
process.exit(2)
|
||||
})
|
||||
|
||||
logger.logger.warn({addr: 'http://'+hostport[0]+':'+hostport[1]+'/', version: 'Sinopia/'+pkg.version}, 'Server is listening on @{addr}')
|
||||
|
||||
// undocumented stuff for tests
|
||||
|
|
Loading…
Add table
Reference in a new issue