Fix error handling bug

Errors were not properly handled as `error` was not bound
This commit is contained in:
Martijn Faassen 2022-02-16 10:25:11 +01:00
parent 7ca56c1691
commit 2b050fb9c7

View File

@ -24,7 +24,7 @@ const startServer = async () => {
server.listen(port)
server.on('error', () => {
server.on('error', (error) => {
if (error.syscall !== 'listen') throw error
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port
// handle specific listen errors with friendly messages