File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -189,8 +189,16 @@ function auditCmd (args, cb) {
189
189
} ) . then ( ( auditReport ) => {
190
190
return audit . submitForFullReport ( auditReport )
191
191
} ) . catch ( ( err ) => {
192
- if ( err . statusCode === 404 || err . statusCode >= 500 ) {
193
- const ne = new Error ( `Your configured registry (${ opts . registry } ) does not support audit requests.` )
192
+ if ( err . statusCode >= 400 ) {
193
+ let msg
194
+ if ( err . statusCode === 401 ) {
195
+ msg = `Either your login credentials are invalid or your registry (${ opts . registry } ) does not support audit.`
196
+ } else if ( err . statusCode === 404 ) {
197
+ msg = `Your configured registry (${ opts . registry } ) does not support audit requests.`
198
+ } else {
199
+ msg = `Your configured registry (${ opts . registry } ) does not support audit requests, or the audit endpoint is temporarily unavailable.`
200
+ }
201
+ const ne = new Error ( msg )
194
202
ne . code = 'ENOAUDIT'
195
203
ne . wrapped = err
196
204
throw ne
You can’t perform that action at this time.
0 commit comments