Skip to content

Commit 2b4d74b

Browse files
author
Guillaume Chau
committed
fix(audit): handle errors
1 parent dcecb94 commit 2b4d74b

File tree

1 file changed

+8
-0
lines changed
  • packages/@vue/cli-ui/ui-defaults/utils

1 file changed

+8
-0
lines changed

packages/@vue/cli-ui/ui-defaults/utils/audit.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ exports.auditProject = async function (cwd) {
2020
reject: false
2121
})
2222

23+
if (child.stderr) {
24+
const errLines = child.stderr.split('\n').map(l => l.trim()).filter(l => l)
25+
const error = errLines.find(l => l.startsWith('Error:'))
26+
if (error) {
27+
throw new Error(error.substr('Error:'.length).trim())
28+
}
29+
}
30+
2331
const data = child.stdout
2432

2533
let auditAdvisories = []

0 commit comments

Comments
 (0)