Skip to content

audit-logging/srv/log2restv2.js - circular dependency in error case #75

@soccermax

Description

@soccermax
      res.on('end', () => {
        let body = Buffer.concat(chunks).toString()
        if (res.headers['content-type']?.match(/json/)) body = JSON.parse(body)
        if (res.statusCode >= 400) {
          const err = new Error(res.statusMessage)
          err.response = res
          err.body = body
          reject(err)
        } else {
          resolve(body)
        }
      })

err.response --> contains circular dependencies. This results in an error if we try to log the error.

image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions