Skip to content

Commit c5e7800

Browse files
committed
wip
1 parent c2f89cb commit c5e7800

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/node/app.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ export const createApp = async (args: DefaultedArgs): Promise<[Express, Express,
4141
try {
4242
await fs.unlink(args.socket)
4343
} catch (error: any) {
44-
if (isNodeJSErrnoException(error) && error.code !== "ENOENT") {
45-
logger.error(error.message)
46-
} else if (!isNodeJSErrnoException(error)) {
47-
logger.error(error)
44+
// TODO@jsjoeio break this out into a separate error handler
45+
// That way we can handle all cases
46+
if (!isNodeJSErrnoException(error) || error.code !== "ENOENT") {
47+
logger.error(error.message ? error.message : error)
4848
}
4949
}
5050
server.listen(args.socket, resolve)

test/unit/node/app.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ describe("handleServerError", () => {
160160
})
161161
})
162162

163-
164163
// TODO@jsjoeio - write
165164
// make a file owned by root
166165
// restrictive permissions - 600
@@ -170,4 +169,8 @@ describe("handleServerError", () => {
170169

171170
// pass in / into
172171
// create a directory and pass that in as the socket
173-
// with one file and use the directory as the socket path
172+
// with one file and use the directory as the socket path
173+
174+
// The other thing I can do is mock fs.unlink
175+
// and make it throw an error
176+
// Stopped

0 commit comments

Comments
 (0)