Skip to content

Commit

Permalink
429 (Too Many Requests) is not unrecoverable error
Browse files Browse the repository at this point in the history
  • Loading branch information
sjvans committed Aug 17, 2023
1 parent ce38f93 commit 9b1134d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions srv/log2restv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = class AuditLog2RESTv2 extends AuditLogService {
const { event, data } = req

// event.match() is used to support the old event names
if (event === 'SensitiveDataRead' || event.match(/^dataAccess/i))
return this._handle(data, 'DATA_ACCESS')
if (event === 'SensitiveDataRead' || event.match(/^dataAccess/i)) return this._handle(data, 'DATA_ACCESS')
if (event === 'PersonalDataModified' || event.match(/^dataModification/i))
return this._handle(data, 'DATA_MODIFICATION')
if (event === 'ConfigurationModified' || event.match(/^configChange/i))
Expand Down Expand Up @@ -65,7 +64,8 @@ module.exports = class AuditLog2RESTv2 extends AuditLogService {
return access_token
} catch (err) {
// 401 could also mean x-zid is not valid
if (String(err.response?.statusCode).match(/^4\d\d$/)) err.unrecoverable = true
if (String(err.response?.statusCode).match(/^4\d\d$/) && err.response?.statusCode !== 429)
err.unrecoverable = true
throw err
}
}
Expand Down

0 comments on commit 9b1134d

Please sign in to comment.