Skip to content

Commit 5889ba0

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 b9367d3 commit 5889ba0

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
@@ -100,11 +100,13 @@ function configure (gyp, argv, callback) {
100100

101101
fs.unlink(symlinkDestination, function (err) {
102102
if (err && err.code !== 'ENOENT') {
103-
log.warn('python symlink', 'error when attempting to remove existing symlink\n', err)
103+
log.warn('python symlink', 'error when attempting to remove existing symlink')
104+
log.warn('python symlink', err.stack)
104105
}
105106
fs.symlink(python, symlinkDestination, function (err) {
106107
if (err) {
107-
log.warn('python symlink', 'error when attempting to create Python symlink\n', err)
108+
log.warn('python symlink', 'error when attempting to create Python symlink')
109+
log.warn('python symlink', err.stack)
108110
}
109111
})
110112
})

0 commit comments

Comments
 (0)