Skip to content

Commit

Permalink
Better error message for missing ssh keys
Browse files Browse the repository at this point in the history
  • Loading branch information
zxlin committed Apr 22, 2021
1 parent 193a7b4 commit 447981a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mitm/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ function loadKeys(mountPath, ctID, cb) {
keys = readCTKeys(mountPath, ctID);
} catch (e) {
console.log(e);
console.log("CRITICAL ERROR: Could not read the keys from the container! Is the container mounted?");
if (e.code === 'EACCES') {
console.log("CRITICAL ERROR: Could not read the keys from the container! Permission denied, are you the root user?");
} else {
console.log("CRITICAL ERROR: Could not read the keys from the container! Is the container mounted/running and is openssh-server installed?");
}
process.exit(1);
}
return cb(keys);
Expand Down

0 comments on commit 447981a

Please sign in to comment.