Skip to content

Commit 8679118

Browse files
committed
lib: improve error formatting for Python symlink
Logging the entire error object shows the stack twice, and all the other information is contained in the stack. It also messes with the order of what is logged. Rather than logging a bunch of redundant information in a messy way, we can log only the stack. Logging it in a separate log.warn() also gets rid of an extra space character at the beginning of the line.
1 parent 6086960 commit 8679118

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/configure.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ function configure (gyp, argv, callback) {
9797

9898
fs.unlink(symlinkDestination, function (err) {
9999
if (err && err.code !== 'ENOENT') {
100-
log.warn('python symlink', 'error when attempting to remove existing symlink\n', err)
100+
log.warn('python symlink', 'error when attempting to remove existing symlink')
101+
log.warn('python symlink', err.stack)
101102
}
102103
fs.symlink(python, symlinkDestination, function (err) {
103104
if (err) {
104-
log.warn('python symlink', 'error when attempting to create Python symlink\n', err)
105+
log.warn('python symlink', 'error when attempting to create Python symlink')
106+
log.warn('python symlink', err.stack)
105107
}
106108
})
107109
})

0 commit comments

Comments
 (0)