Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit b3e5577

Browse files
committed
Add port In Use error message
1 parent 5bbdc58 commit b3e5577

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ export async function serve({ app, port, hostname, certFile, keyFile }: ServeOpt
220220
server.handle(r)
221221
}
222222
} catch (err) {
223-
if (err instanceof Deno.errors.AddrInUse && app.isDev) {
223+
if (err instanceof Deno.errors.AddrInUse) {
224+
if (!app.isDev) {
225+
log.fatal(`port ${port} already in use!`)
226+
}
224227
log.warn(`port ${port} already in use, try ${port + 1}...`)
225228
port++
226229
} else {

0 commit comments

Comments
 (0)