Skip to content

Commit cbd4785

Browse files
committed
update and handle unsuccessful response
1 parent 74e8eaa commit cbd4785

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/commands/info/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues, strict
134134
return handleUnsuccessfulApiResponse('getIssuesByNPMPackage', result, spinner)
135135
}
136136

137+
if (scoreResult.success === false) {
138+
return handleUnsuccessfulApiResponse('getScoreByNPMPackage', scoreResult, spinner)
139+
}
140+
137141
// Conclude the status of the API call
138142

139143
const severityCount = getSeverityCount(result.data, includeAllIssues ? undefined : 'high')
@@ -148,7 +152,6 @@ async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues, strict
148152
return {
149153
data: result.data,
150154
severityCount,
151-
// @ts-ignore
152155
score: scoreResult.data
153156
}
154157
}

0 commit comments

Comments
 (0)