Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c354195

Browse files
committedOct 9, 2015
Improved error handling
1 parent 94b5045 commit c354195

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
 

‎audit-package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ getArtifactMatches = function(pkgs, artifacts) {
228228
var artifact = undefined;
229229
if(j < artifacts.length) artifact = artifacts[j];
230230
var matchedArtifact = undefined;
231-
while(artifact != undefined && artifact.search[1] == name) {
231+
while(artifact != undefined && artifact.search != undefined && artifact.search[1] == name) {
232232
if(matchedArtifact == undefined) {
233233
matchedArtifact = artifact;
234234
}

‎audit.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,12 @@ function resultCallback(err, pkg, details) {
297297
}
298298

299299
if(err) {
300-
console.log(colors.bold.red("Error running audit: " + err));
300+
if(err.error) {
301+
console.log(colors.bold.red("Error running audit: " + err.error + " (" + err.code + ")"));
302+
}
303+
else {
304+
console.log(colors.bold.red("Error running audit: " + err));
305+
}
301306
if(err.stack) {
302307
console.log(err.stack);
303308
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "auditjs",
3-
"version": "0.0.17",
3+
"version": "0.0.19",
44
"description": "Audit dependencies to identify known vulnerabilities and maintenance problems",
55
"main": "audit-package.js",
66
"bin": "./audit.js",

0 commit comments

Comments
 (0)
Please sign in to comment.