Skip to content

Commit

Permalink
fix: gracefully handle when satellite cannot bind REST port (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdadams authored Sep 23, 2024
1 parent a3428c3 commit 014562a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions satellite/src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ export class RestServer {
const port = this.appConfig.get('restPort')

if (enabled && port) {
this.server = this.app.listen(port)
console.log(`REST server starting: port: ${port}`)
try {
this.server = this.app.listen(port)
console.log(`REST server starting: port: ${port}`)
} catch (error) {
console.error('Error starting REST server:', error)
}
} else {
console.log('REST server not starting: port 0')
}
Expand Down

0 comments on commit 014562a

Please sign in to comment.