Skip to content

Commit

Permalink
dont die when listening is hard
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Nov 17, 2020
1 parent 3733ea9 commit de7025c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Expand Up @@ -82,7 +82,15 @@ async function listen(request, response, name, scope) {
send(response, 408, "That took too long! please try again")
})
}, 60000)
server.listen(sockPath)
try {
server.listen(sockPath)
} catch (error) {
send(
response,
500,
"something went wrong trying to listen ,perhaps you are listening on another tab or are the victim of a DoS attack?"
)
}
}

async function notfound(request, response) {
Expand Down

0 comments on commit de7025c

Please sign in to comment.