Skip to content

Commit 4bcaf21

Browse files
Improve the error messaging for permissions
If an invalid setup with directory permissions happened, it doesn't mean an invalid port. It usually implies it is a setup error. Add the handling for the mkdir sys call.
1 parent 7e7fb8a commit 4bcaf21

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/lib/start.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ function bin (argv, server) {
122122
app = solid.createServer(argv, server)
123123
} catch (e) {
124124
if (e.code === 'EACCES') {
125-
console.log(colors.red.bold('ERROR'), 'You need root privileges to start on this port')
125+
if (e.syscall === 'mkdir') {
126+
console.log(colors.red.bold('ERROR'), `You need permissions to create '${e.path}' folder`)
127+
}
128+
else {
129+
console.log(colors.red.bold('ERROR'), 'You need root privileges to start on this port')
130+
}
126131
return 1
127132
}
128133
if (e.code === 'EADDRINUSE') {

0 commit comments

Comments
 (0)