Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(startup): if error on startup, log and exit
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgm committed Oct 29, 2015
1 parent 4812c79 commit 2c4df03
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/key_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ function main() {
server = Server.create(log, error, config, routes, db)

server.start(
function () {
log.info({ op: 'server.start.1', msg: 'running on ' + server.info.uri })
function (err) {
if (err) {
log.error({ op: 'server.start.1', msg: 'failed startup with error',
err: { message: err.message } })
process.exit(1)
} else {
log.info({ op: 'server.start.1', msg: 'running on ' + server.info.uri })
}
}
)
statsInterval = setInterval(logStatInfo, 15000)
Expand Down

0 comments on commit 2c4df03

Please sign in to comment.